diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-08-20 17:35:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-08-20 17:35:06 +0200 |
commit | 8c3dfa7d47950a207cebf3af5da5669a54587c4c (patch) | |
tree | 2d8badd688725a77fc53f7a04a8c5c6b9557f930 /src/fsck/fsck.c | |
parent | manager: simplify manager_get_confirm_spawn() a bit (diff) | |
download | systemd-8c3dfa7d47950a207cebf3af5da5669a54587c4c.tar.xz systemd-8c3dfa7d47950a207cebf3af5da5669a54587c4c.zip |
fsck: add logging and fix error codes where appropriate
Diffstat (limited to '')
-rw-r--r-- | src/fsck/fsck.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c index 0a5863667c..935dce9d21 100644 --- a/src/fsck/fsck.c +++ b/src/fsck/fsck.c @@ -169,12 +169,12 @@ static int process_progress(int fd) { f = fdopen(fd, "r"); if (!f) { safe_close(fd); - return -errno; + return log_debug_errno(errno, "Failed to use pipe: %m"); } console = fopen("/dev/console", "we"); if (!console) - return -ENOMEM; + return log_debug_errno(errno, "Failed to open /dev/console, can't print progress output: %m"); for (;;) { int pass, m; @@ -189,10 +189,9 @@ static int process_progress(int fd) { r = log_warning_errno(errno, "Failed to read from progress pipe: %m"); else if (feof(f)) r = 0; - else { - log_warning("Failed to parse progress pipe data"); - r = -EBADMSG; - } + else + r = log_warning_errno(SYNTHETIC_ERRNO(errno), "Failed to parse progress pipe data"); + break; } |