X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-info.c;h=7854b099e8a89fc2088351bde877126d8504a279;hb=9ab266df6642c6e930e03b3024d7c3d53ef88bbc;hp=1a7724bb5ef487738a8db0a120cd86d1af57e64d;hpb=26d75de504d808191dbadc9a735009a214a789b0;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-info.c b/src/wgtpkg-info.c index 1a7724b..7854b09 100644 --- a/src/wgtpkg-info.c +++ b/src/wgtpkg-info.c @@ -105,51 +105,15 @@ int main(int ac, char **av) return 0; } -static struct wgt *wgt_at_workdir() -{ - int rc, wfd; - struct wgt *wgt; - - wfd = workdirfd(); - if (wfd < 0) - return NULL; - - wgt = wgt_create(); - if (!wgt) { - syslog(LOG_ERR, "failed to allocate wgt"); - close(wfd); - return NULL; - } - - rc = wgt_connectat(wgt, wfd, NULL); - if (rc) { - syslog(LOG_ERR, "failed to connect wgt to workdir"); - close(wfd); - wgt_unref(wgt); - return NULL; - } - - return wgt; -} - - static int check_and_show() { - struct wgt *wgt; struct wgt_info *ifo; - wgt = wgt_at_workdir(); - if (!wgt) - return -1; - - ifo = wgt_info_get(wgt, 1, 1, 1); - if (!ifo) { - wgt_unref(wgt); + ifo = wgt_info_createat(workdirfd, NULL, 1, 1, 1); + if (!ifo) return -1; - } wgt_info_dump(ifo, 1, ""); wgt_info_unref(ifo); - wgt_unref(wgt); return 0; } @@ -164,9 +128,6 @@ static void show(const char *wgtfile) return; } - if (enter_workdir(0)) - goto error2; - if (zread(wgtfile, 0)) goto error2;