From: John Crispin Date: Tue, 9 Jul 2013 12:30:39 +0000 (+0200) Subject: improve e2fsck handling X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fubox.git;a=commitdiff_plain;h=01c0caf457a55488cfb749a0c17bbbd7e24d4328;ds=sidebyside improve e2fsck handling Signed-off-by: John Crispin --- diff --git a/block.c b/block.c index 15f4b0f..2108a8d 100644 --- a/block.c +++ b/block.c @@ -456,11 +456,10 @@ static void check_filesystem(struct blkid_struct_probe *pr) return; } - if (stat(e2fsck, &statbuf) < 0) - return; - - if (!(statbuf.st_mode & S_IXUSR)) + if (stat(e2fsck, &statbuf) < 0) { + fprintf(stderr, "check_filesystem: %s not found\n", e2fsck); return; + } pid = fork(); if (!pid) { @@ -468,7 +467,10 @@ static void check_filesystem(struct blkid_struct_probe *pr) exit(-1); } else if (pid > 0) { int status; + waitpid(pid, &status, 0); + if (WEXITSTATUS(status)) + fprintf(stderr, "check_filesystem: %s returned %d\n", e2fsck, WEXITSTATUS(status)); } }