]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fstab-generator: put What= before Where=
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 Aug 2021 06:37:50 +0000 (08:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Aug 2021 11:29:08 +0000 (13:29 +0200)
All units in units/ follow this pattern, as do all other generators that we
provide. The question of the order was raised in
https://github.com/systemd/zram-generator/pull/90#discussion_r684965984,
and I think it's nice to make it consistent everywhere
(What= before Where= matches mount(8) and fstab(5)).

src/fstab-generator/fstab-generator.c

index bafc7b8f960bb5d2a75dbeea1d8edc1cd6166471..bae67be09f1434929b60d87f4833b5a7d09028c8 100644 (file)
@@ -451,6 +451,10 @@ static int add_mount(
                 "\n"
                 "[Mount]\n");
 
+        r = write_what(f, what);
+        if (r < 0)
+                return r;
+
         if (original_where)
                 fprintf(f, "# Canonicalized from %s\n", original_where);
 
@@ -459,10 +463,6 @@ static int add_mount(
                 return log_oom();
         fprintf(f, "Where=%s\n", where_escaped);
 
-        r = write_what(f, what);
-        if (r < 0)
-                return r;
-
         if (!isempty(fstype) && !streq(fstype, "auto")) {
                 _cleanup_free_ char *t = NULL;