]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/machine-id-setup.c
coccinelle: make use of SYNTHETIC_ERRNO
[thirdparty/systemd.git] / src / core / machine-id-setup.c
index 248a83847eeedf97e79f21e35ef9f5d2ec40d004..4dfdc475baf8ea930d5ca25e77e50d25c4586952 100644 (file)
@@ -200,10 +200,10 @@ int machine_id_commit(const char *root) {
         r = fd_is_temporary_fs(fd);
         if (r < 0)
                 return log_error_errno(r, "Failed to determine whether %s is on a temporary file system: %m", etc_machine_id);
-        if (r == 0) {
-                log_error("%s is not on a temporary file system.", etc_machine_id);
-                return -EROFS;
-        }
+        if (r == 0)
+                return log_error_errno(SYNTHETIC_ERRNO(EROFS),
+                                       "%s is not on a temporary file system.",
+                                       etc_machine_id);
 
         r = id128_read_fd(fd, ID128_PLAIN, &id);
         if (r < 0)