diff options
| author | Michael Forney <mforney@mforney.org> | 2016-12-10 00:42:36 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2016-12-10 11:56:37 -0800 |
| commit | 1a47d9c6870e4b4e4fcd033d184f31a5b94a7a47 (patch) | |
| tree | 720785fb55afcb0eb7cf6a87aa56d6c58ce095ae /util | |
| parent | f5ce61b14a53a3e49665473bd2ec5538168b5597 (diff) | |
perms-hook: Minor style fixes
Diffstat (limited to 'util')
| -rw-r--r-- | util/perms-hook.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/util/perms-hook.c b/util/perms-hook.c index cc885bef..7f92053b 100644 --- a/util/perms-hook.c +++ b/util/perms-hook.c @@ -41,12 +41,12 @@ extern char **environ; static dev_t rootdev; static struct special oldsp, newsp; -static int failure; +static int status; static void verror(char *fmt, va_list ap) { - failure = 1; + status = 1; vfprintf(stderr, fmt, ap); if (fmt[0] && fmt[strlen(fmt)-1] == ':') fprintf(stderr, " %s", strerror(errno)); @@ -330,10 +330,13 @@ readchanges(char *old, char *new) die("child process failed"); } -int main(int argc, char *argv[]) { - char *old, *new; +int +main(int argc, char *argv[]) +{ + char *prog, *old, *new; struct stat st; + prog = basename(argv[0]); switch (argc) { case 1: old = NULL; @@ -348,7 +351,7 @@ int main(int argc, char *argv[]) { new = argv[2]; break; default: - fprintf(stderr, "usage: %s [[old] new]\n", basename(argv[0])); + fprintf(stderr, "usage: %s [[old] new]\n", prog); exit(2); } @@ -364,5 +367,5 @@ int main(int argc, char *argv[]) { umask(0); readchanges(old, new); - return failure; + return status; } |
