Commit Graph

7 Commits

Author SHA1 Message Date
Hiltjo Posthuma 066a0306a1 fork: no need to _exit() on the error case 2015-03-10 20:05:18 +01:00
FRIGN 6f207dac5f Don't return but _exit after failed exec*() and fork()
Quoting POSIX[0]:
"Care should be taken, also, to call _exit() rather than exit() if exec cannot be used, since
exit() flushes and closes standard I/O channels, thereby damaging the parent process' standard
I/O data structures. (Even with fork(), it is wrong to call exit(), since buffered data would
then be flushed twice.)"

[0]: http://pubs.opengroup.org/onlinepubs/009695399/functions/vfork.html
2015-03-09 01:12:59 +01:00
Hiltjo Posthuma 603499b674 time: show which signal terminated the program, exit status
The exit status when a program is signaled is not specified in POSIX afaik.
The GNU behaviour of 128 + signalno is used.
2015-03-08 12:51:42 +01:00
FRIGN 1250a8962f Audit time(1)
1) fix usage().
2) sort includes and comment properly. rename rbeg and rend to r0 and r1.
3) argc style and usage fixes.
4) make error-messages clearer.
5) BUGFIX: It was ignored when fork() failed.
6) Don't call enprintf() after execvp and use _exit instead.
2015-03-05 00:23:09 +01:00
sin d083a94731 time: errno is not guaranteed to be set for sysconf()
0 should be considered an invalid CLK_TCK.
2015-02-28 14:36:50 +00:00
sin 84e7fbda24 time(1) cleanup 2015-02-27 21:43:11 +00:00
Evan Gates 5c8d5c1dca add time. do not mark complete/POSIX compliant as exit status is wrong. 2015-02-27 21:39:50 +00:00