]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
install: shorten code a bit 33408/head
authorLennart Poettering <lennart@poettering.net>
Tue, 18 Jun 2024 15:09:34 +0000 (17:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Jun 2024 14:27:13 +0000 (16:27 +0200)
This changes behaviour a bit, since we now keep track of OOM errors in
install_changes_add(). Which I'd argue is a good thing.

src/shared/install.c

index 70ba230ac16ab1ca7c7f59fe9edb64773236e825..08c2915fb5326e76b11974c828a2410a153d7313 100644 (file)
@@ -2454,10 +2454,8 @@ int unit_file_unmask(
                         return -ENOMEM;
 
                 if (!dry_run && unlink(path) < 0) {
-                        if (errno != ENOENT) {
-                                RET_GATHER(r, -errno);
-                                install_changes_add(changes, n_changes, -errno, path, NULL);
-                        }
+                        if (errno != ENOENT)
+                                RET_GATHER(r, install_changes_add(changes, n_changes, -errno, path, NULL));
 
                         continue;
                 }