diff options
| author | Michael Heimpold | 2018-11-24 09:22:44 +0000 |
|---|---|---|
| committer | John Crispin | 2018-11-26 08:46:01 +0000 |
| commit | e12c0d64a1446be30135954502a6f747b138e4e5 (patch) | |
| tree | 255870c09459b39c437e6108f39f21f95d2a068c | |
| parent | 091aa3d72dcbbfdb4795bb17e260e35a635b0bf5 (diff) | |
| download | fstools-e12c0d64a1446be30135954502a6f747b138e4e5.tar.gz | |
fstools: use EXIT_FAILURE when indicating error on exit
According to man page, using the EXIT_* macros is more portable than using
plain integer values.
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
| -rw-r--r-- | block.c | 8 | ||||
| -rw-r--r-- | blockd.c | 4 |
2 files changed, 6 insertions, 6 deletions
@@ -742,16 +742,16 @@ static void check_filesystem(struct probe_info *pr) if (!pid) { if(!strncmp(pr->type, "f2fs", 4)) { execl(ckfs, ckfs, "-f", pr->dev, NULL); - exit(-1); + exit(EXIT_FAILURE); } else if(!strncmp(pr->type, "btrfs", 5)) { execl(ckfs, ckfs, "--repair", pr->dev, NULL); - exit(-1); + exit(EXIT_FAILURE); } else if(!strncmp(pr->type, "ntfs", 4)) { execl(ckfs, ckfs, "-b", pr->dev, NULL); - exit(-1); + exit(EXIT_FAILURE); } else { execl(ckfs, ckfs, "-p", pr->dev, NULL); - exit(-1); + exit(EXIT_FAILURE); } } else if (pid > 0) { int status; @@ -95,7 +95,7 @@ block(char *cmd, char *action, char *device) argv[a++] = device; execvp(argv[0], argv); ULOG_ERR("failed to spawn %s %s %s\n", *argv, action, device); - exit(-1); + exit(EXIT_FAILURE); default: waitpid(pid, &status, 0); @@ -422,7 +422,7 @@ static int autofs_mount(void) if (kproto_version != 5) { ULOG_ERR("only kernel protocol version 5 is tested. You have %d.\n", kproto_version); - exit(1); + exit(EXIT_FAILURE); } if (ioctl(fd_autofs_write, AUTOFS_IOC_SETTIMEOUT, &autofs_timeout)) ULOG_ERR("failed to set autofs timeout\n"); |