Xin LI
778ac8d371
Remove unused include.
...
MFC after: 2 weeks
2020-02-02 20:51:28 +00:00
Pawel Jakub Dawidek
d731a314d3
Restore previous usage presentation (without "pwait: " prefix).
...
Pointed out by: jilles
2020-02-01 09:13:11 +00:00
Pawel Jakub Dawidek
9677354790
Style changes, mostly usage of braces around single line statements -
...
it is safer and allowed for some time now by style(9).
Sponsored by: Fudo Security
2020-01-26 11:13:34 +00:00
Pawel Jakub Dawidek
2362bc2cf5
Implement -o flag which tells pwait(1) to exit if any of the given processes
...
has terminated.
Sponsored by: Fudo Security
2020-01-26 11:02:51 +00:00
Pawel Jakub Dawidek
5e2e2222ae
Don't setup a timeout if we are exiting.
...
Sponsored by: Fudo Security
2020-01-26 10:54:16 +00:00
Pawel Jakub Dawidek
3f50bbaf51
Check for duplicated PID without using additional variable.
...
Sponsored by: Fudo Security
2020-01-26 10:51:57 +00:00
Pawel Jakub Dawidek
532b3f4791
- Be consistent with using sysexits(3) codes.
...
- Turn fprintf()+exit() into errx().
Sponsored by: Fudo Security
2020-01-26 10:49:24 +00:00
Bryan Drewery
b06b52baac
pwait: Add a -t flag to specify a timeout before exiting, and tests.
...
The exit status will be 124, as the timeout(1) utility uses.
Reviewed by: jilles
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9697
2017-03-07 22:16:55 +00:00
Xin LI
f3de285bbf
Use a different way to silence clang analyzer as done in r245494 by
...
explicitly telling the compiler that we are on the exit route.
X-MFC: together with r245494
2013-01-16 18:15:25 +00:00
Eitan Adler
28e4657584
Free memory before exiting in order to silence a warning from the clang
...
static analyzer
Approved by: cperciva
MFC after: 3 days
2013-01-16 05:03:52 +00:00
Jilles Tjoelker
0e5e416780
Add pwait utility, which waits for any process to terminate.
...
This is similar to the Solaris utility of the same name.
Some use cases:
* rc.subr's wait_for_pids
* interactive use, e.g. to shut down the computer when some task is done
even if the task is already running
Discussed on: hackers@
2009-11-17 22:47:20 +00:00