From: Michael Tremer Date: Sun, 17 Jul 2022 17:05:37 +0000 (+0000) Subject: pakfire: Correctly set return code on initialization errors X-Git-Tag: 0.9.28~698 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37f5a30e32a6394fc0628d4f1bbdf077d43b51bf;p=pakfire.git pakfire: Correctly set return code on initialization errors Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index 96dff26a6..3cd962fee 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -758,8 +758,10 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path, // Generate a random path if none is set if (!path) { path = pakfire_mkdtemp(tempdir); - if (!path) + if (!path) { + r = 1; goto ERROR; + } // Mount this as tmpfs p->mount_tmpfs = !pakfire_has_flag(p, PAKFIRE_FLAGS_DISABLE_RAMDISK); @@ -853,8 +855,10 @@ PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path, // Make path for private files char private_dir[PATH_MAX]; r = pakfire_make_path(p, private_dir, PAKFIRE_PRIVATE_DIR); - if (r < 0) + if (r < 0) { + r = 1; goto ERROR; + } // Make sure that our private directory exists r = pakfire_mkdir(private_dir, 0);