]> git.ipfire.org Git - pakfire.git/commitdiff
file: Ignore if the file was already deleted
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 16:15:41 +0000 (16:15 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 16:15:53 +0000 (16:15 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/file.c

index 0ed5269e12200cd5fbbdd96ee912dd22350a2ee0..f5ea7527bdcb8098016981aeb7a7c5e940e3b83b 100644 (file)
@@ -366,9 +366,18 @@ int pakfire_file_remove(struct pakfire_file* file) {
 
        int r = remove(file->abspath);
        if (r) {
-               // Ignore when we could not remove directories
-               if (errno == ENOTEMPTY)
-                       return 0;
+               switch (errno) {
+                       // Ignore when we could not remove directories
+                       case ENOTEMPTY:
+                               return 0;
+
+                       // Ignore if the file didn't exist
+                       case ENOENT:
+                               return 0;
+
+                       default:
+                               break;
+               }
 
                ERROR(file->pakfire, "Could not remove %s (%s): %m\n", file->path, file->abspath);
        }