X-Git-Url: https://git.draconx.ca/gitweb/upkg.git/blobdiff_plain/82202f3afe5b662d6896e91903e491630c1ec7dd..1906020cf2abc26cf8317a5a754dca7318802250:/src/upkg.c diff --git a/src/upkg.c b/src/upkg.c index 4a76fa2..ef44bf6 100644 --- a/src/upkg.c +++ b/src/upkg.c @@ -154,17 +154,15 @@ int package_info(struct upkg *pkg) static int export(struct upkg *pkg, GObject *obj, unsigned idx) { - struct upkg_file *f = upkg_export_open(pkg, idx); char name[256]; FILE *of; - int rc = -1; - if (u_object_deserialize(obj, f) != 0) { - goto out; + if (u_object_deserialize(obj, pkg, idx) != 0) { + return -1; } if (U_OBJECT_IS_LOADABLE(obj) && u_object_load(obj) != 0) { - goto out; + return -1; } u_object_export_name(obj, name, sizeof name); @@ -173,24 +171,21 @@ static int export(struct upkg *pkg, GObject *obj, unsigned idx) of = fopen(name, "wb"); if (!of) { perror(name); - goto out; + return -1; } - rc = u_object_export(obj, of); + u_object_export(obj, of); if (fclose(of) != 0) { perror(name); - rc = -1; - goto out; + return -1; } if (U_OBJECT_IS_LOADABLE(obj)) { u_object_unload(obj); } -out: - upkg_export_close(f); - return rc; + return 0; } int package_export(struct upkg *pkg)