]> git.ipfire.org Git - pakfire.git/commitdiff
packager: Fix return codes
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Aug 2022 13:42:20 +0000 (13:42 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Aug 2022 13:42:20 +0000 (13:42 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/packager.c

index afe0d2c517c6875f9a4575654353b70ed74084b1..c6e1485be096a08cea6fd1418a61209f84b32048 100644 (file)
@@ -645,8 +645,10 @@ int pakfire_packager_add(struct pakfire_packager* packager,
        FILE* f = NULL;
 
        // Check if path is set
-       if (!sourcepath)
-               return EINVAL;
+       if (!sourcepath) {
+               errno = EINVAL;
+               return 1;
+       }
 
        // Use basename if path isn't set
        if (!path) {
@@ -662,7 +664,7 @@ int pakfire_packager_add(struct pakfire_packager* packager,
        // Create a new file entry
        struct archive_entry* entry = archive_entry_new();
        if (!entry)
-               return ENOMEM;
+               return 1;
 
        DEBUG(packager->pakfire, "Adding '%s' to archive (from %s)\n", path, sourcepath);