Skip to content

Commit

Permalink
Lockf was exiting with status 1 if the command did not exit normally.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dwmalone committed Aug 21, 2008
1 parent aeb6db0 commit 6df81d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions usr.bin/lockf/lockf.1
Original file line number Diff line number Diff line change
Expand Up @@ -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 ,
Expand Down
2 changes: 1 addition & 1 deletion usr.bin/lockf/lockf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 6df81d1

Please sign in to comment.