diff options
author | Tom Gundersen <teg@jklm.no> | 2015-10-25 14:22:43 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-10-25 14:22:43 +0100 |
commit | 7c8871d31510865e40c8628ef765996202a3cc00 (patch) | |
tree | 622b7aa085999fe3d2908772ff0d0c6ec5bf4400 /src/shared/generator.c | |
parent | 7c257428969aaba2acc4e26753c86d6f4774354a (diff) | |
parent | f00022dd121c73b543ae667ddce9814bd67a1b73 (diff) |
Merge pull request #1654 from poettering/util-lib
Various changes to src/basic/
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r-- | src/shared/generator.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c index e58bbea77c..0a8e282949 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -21,21 +21,23 @@ #include <unistd.h> -#include "util.h" -#include "special.h" -#include "mkdir.h" -#include "unit-name.h" +#include "dropin.h" +#include "escape.h" +#include "fd-util.h" +#include "fileio.h" +#include "fstab-util.h" #include "generator.h" +#include "mkdir.h" #include "path-util.h" -#include "fstab-util.h" -#include "fileio.h" -#include "dropin.h" +#include "special.h" +#include "string-util.h" +#include "unit-name.h" +#include "util.h" static int write_fsck_sysroot_service(const char *dir, const char *what) { - const char *unit; - _cleanup_free_ char *device = NULL; - _cleanup_free_ char *escaped; + _cleanup_free_ char *device = NULL, *escaped = NULL; _cleanup_fclose_ FILE *f = NULL; + const char *unit; int r; escaped = cescape(what); @@ -101,16 +103,17 @@ int generator_write_fsck_deps( if (!isempty(fstype) && !streq(fstype, "auto")) { r = fsck_exists(fstype); - if (r == -ENOENT) { + if (r < 0) + log_warning_errno(r, "Checking was requested for %s, but couldn't detect if fsck.%s may be used, proceeding: %m", what, fstype); + else if (r == 0) { /* treat missing check as essentially OK */ - log_debug_errno(r, "Checking was requested for %s, but fsck.%s does not exist: %m", what, fstype); + log_debug("Checking was requested for %s, but fsck.%s does not exist.", what, fstype); return 0; - } else if (r < 0) - return log_warning_errno(r, "Checking was requested for %s, but fsck.%s cannot be used: %m", what, fstype); + } } if (path_equal(where, "/")) { - char *lnk; + const char *lnk; lnk = strjoina(dir, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service"); |