Commit Graph

14 Commits

Author SHA1 Message Date
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
FRIGN b7c199e050 Include sys/stat.h in nohup(1)
I accidentally removed it, but it's needed to compile on OpenBSD.
2015-03-05 00:57:14 +01:00
FRIGN a6ee96af7c Audit nohup(1)
1) no need to include sys/stat.h
2) remove the enum which just added a layer too thick on this simple
   program
3) argc-style, other style
4) weprintf instead of enprintf, then save the error-message of
   execvp before and return the proper status.
5) write consistent "not reached" comment.
2015-03-04 22:39:12 +01:00
FRIGN 31572c8b0e Clean up #includes 2015-02-14 21:12:23 +01:00
FRIGN 7b6d918b78 Add mandoc-manpage for nohup(1)
and mark it as finished in README.
2015-01-28 23:55:57 +01:00
FRIGN 1436518f9d Use < 0 instead of == -1 2014-11-19 20:09:29 +00:00
sin de4a36957e Silence stupid warnings when building sbase-box 2014-11-17 10:52:24 +00:00
FRIGN eee98ed3a4 Fix coding style
It was about damn time. Consistency is very important in such a
big codebase.
2014-11-13 18:08:43 +00:00
sin 44b3ea8f76 Use _exit() instead of return if exec* fails 2014-11-13 17:06:41 +00:00
Hiltjo Posthuma 953ebf3573 code style
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-06-01 18:02:30 +01:00
stateless 7216a53a7e Remove unnecessary exit(1) in usage()
Signed-off-by: Christoph Lohmann <20h@r-36.net>
2013-06-19 19:58:19 +02:00
Christoph Lohmann 4d38f60685 Eliminating the getopt disgrace. 2013-06-14 20:20:47 +02:00
Connor Lane Smith 572f5e926c simpler nohup 2011-06-24 08:33:08 +01:00
Connor Lane Smith f24772dcbb add nohup 2011-06-18 06:41:28 +01:00