diff options
author | José Bollo <jose.bollo@iot.bzh> | 2015-12-11 14:57:32 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2015-12-11 14:57:32 +0100 |
commit | 9ab266df6642c6e930e03b3024d7c3d53ef88bbc (patch) | |
tree | 95c7686ad33af3c012a02412938f9b2c0191dc7b /src/wgtpkg-info.c | |
parent | 26d75de504d808191dbadc9a735009a214a789b0 (diff) |
don't change of directory anymore
Change-Id: I9f5906d3e053b3fa0f3000d07c4af3f666fe079a
Diffstat (limited to 'src/wgtpkg-info.c')
-rw-r--r-- | src/wgtpkg-info.c | 43 |
1 files changed, 2 insertions, 41 deletions
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; |