]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/rfkill/rfkill.c
coccinelle: make use of SYNTHETIC_ERRNO
[thirdparty/systemd.git] / src / rfkill / rfkill.c
index ec8d91af7914be5a295c6bed5acf3f500cbf01e2..977d2adb3677a101969f0d3641b66a8560dda7d0 100644 (file)
@@ -251,10 +251,9 @@ static int load_state(
         l = write(rfkill_fd, &we, sizeof(we));
         if (l < 0)
                 return log_error_errno(errno, "Failed to restore rfkill state for %i: %m", event->idx);
-        if (l != sizeof(we)) {
-                log_error("Couldn't write rfkill event structure, too short.");
-                return -EIO;
-        }
+        if (l != sizeof(we))
+                return log_error_errno(SYNTHETIC_ERRNO(EIO),
+                                       "Couldn't write rfkill event structure, too short.");
 
         log_debug("Loaded state '%s' from %s.", one_zero(b), state_file);
         return 0;