diff options
author | dwmalone <dwmalone@FreeBSD.org> | 2008-08-21 07:36:17 +0000 |
---|---|---|
committer | dwmalone <dwmalone@FreeBSD.org> | 2008-08-21 07:36:17 +0000 |
commit | 6df81d1188771f0e9c86c5cb6d7282650c1fc353 (patch) | |
tree | 3fa4413e433985a4437455ae8b767955695e9a81 /usr.bin/lockf | |
parent | aeb6db009284ab77dba7815ac89f692a5ca5cfdc (diff) | |
download | FreeBSD-src-6df81d1188771f0e9c86c5cb6d7282650c1fc353.zip FreeBSD-src-6df81d1188771f0e9c86c5cb6d7282650c1fc353.tar.gz |
Lockf was exiting with status 1 if the command did not exit normally.
This is easy to confuse with the actual exit status of the program.
Instead exit with EX_SOFTWARE if the command doesn't exit normally.
MFC after: 1 month
Diffstat (limited to 'usr.bin/lockf')
-rw-r--r-- | usr.bin/lockf/lockf.1 | 5 | ||||
-rw-r--r-- | usr.bin/lockf/lockf.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/lockf/lockf.1 b/usr.bin/lockf/lockf.1 index e8ce3ff..6e2e06e 100644 --- a/usr.bin/lockf/lockf.1 +++ b/usr.bin/lockf/lockf.1 @@ -138,6 +138,11 @@ command line. A system call (e.g., .Xr fork 2 ) failed unexpectedly. +.It Dv EX_SOFTWARE +The +.Ar command +did not exit normally, +but may have been signaled or stopped. .El .Sh SEE ALSO .Xr flock 2 , diff --git a/usr.bin/lockf/lockf.c b/usr.bin/lockf/lockf.c index 843f061..368eed0 100644 --- a/usr.bin/lockf/lockf.c +++ b/usr.bin/lockf/lockf.c @@ -151,7 +151,7 @@ main(int argc, char **argv) signal(SIGTERM, killed); if (waitpid(child, &status, 0) == -1) err(EX_OSERR, "waitpid failed"); - return (WIFEXITED(status) ? WEXITSTATUS(status) : 1); + return (WIFEXITED(status) ? WEXITSTATUS(status) : EX_SOFTWARE); } /* |