]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
import-ceds: use the right error variables at four places
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Jul 2022 16:02:36 +0000 (18:02 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 14 Jul 2022 12:52:11 +0000 (21:52 +0900)
src/core/import-creds.c

index 8b87434683d439e16633dffba9f0a354d9f223d9..53796484ee3f6457b836940ebe60a9c6e53afece 100644 (file)
@@ -226,7 +226,7 @@ static int import_credentials_boot(void) {
                         if (nfd == -EEXIST)
                                 continue;
                         if (nfd < 0)
-                                return r;
+                                return nfd;
 
                         r = copy_bytes(cfd, nfd, st.st_size, 0);
                         if (r < 0) {
@@ -325,7 +325,7 @@ static int proc_cmdline_callback(const char *key, const char *value, void *data)
         if (nfd == -EEXIST)
                 return 0;
         if (nfd < 0)
-                return r;
+                return nfd;
 
         r = loop_write(nfd, colon, l, /* do_poll= */ false);
         if (r < 0) {
@@ -417,7 +417,7 @@ static int import_credentials_qemu(ImportCredentialContext *c) {
 
                 rfd = openat(vfd, "raw", O_RDONLY|O_CLOEXEC);
                 if (rfd < 0) {
-                        log_warning_errno(r, "Failed to open '" QEMU_FWCFG_PATH "'/%s/raw, ignoring: %m", d->d_name);
+                        log_warning_errno(errno, "Failed to open '" QEMU_FWCFG_PATH "'/%s/raw, ignoring: %m", d->d_name);
                         continue;
                 }
 
@@ -429,7 +429,7 @@ static int import_credentials_qemu(ImportCredentialContext *c) {
                 if (nfd == -EEXIST)
                         continue;
                 if (nfd < 0)
-                        return r;
+                        return nfd;
 
                 r = copy_bytes(rfd, nfd, sz, 0);
                 if (r < 0) {