chiark / gitweb /
treewide: more log_*_errno + return simplifications
[elogind.git] / src / fstab-generator / fstab-generator.c
index 14e664236ed24c01a99a931d058cf225d3fbf30d..4e50151ecdb6283b5d2626eb012d0a48465c896a 100644 (file)
@@ -133,10 +133,8 @@ static int add_swap(
                 fprintf(f, "Options=%s\n", me->mnt_opts);
 
         r = fflush_and_check(f);
-        if (r < 0) {
-                log_error("Failed to write unit file %s: %s", unit, strerror(-r));
-                return r;
-        }
+        if (r < 0)
+                return log_error_errno(r, "Failed to write unit file %s: %m", unit);
 
         /* use what as where, to have a nicer error message */
         r = generator_write_timeouts(arg_dest, what, what, me->mnt_opts, NULL);
@@ -600,7 +598,7 @@ int main(int argc, char *argv[]) {
 
         r = parse_proc_cmdline(parse_proc_cmdline_item);
         if (r < 0)
-                log_warning("Failed to parse kernel command line, ignoring: %s", strerror(-r));
+                log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
 
         /* Always honour root= and usr= in the kernel command line if we are in an initrd */
         if (in_initrd()) {