CODING_STYLE: clarify that exit() is never OK to call

This commit is contained in:
Lennart Poettering 2015-04-02 12:14:43 +02:00
parent f4ac4d1a82
commit 3dbafa39b0
1 changed files with 6 additions and 0 deletions

View File

@ -226,3 +226,9 @@
instead of just this:
unlink("/foo/bar/baz");
- Don't invoke exit(), ever. It is not replacement for proper error
handling. Please escalate errors up your call chain, and use normal
"return" to exit from the main function of a process. If you
fork()ed off a child process, please use _exit() instead of exit(),
so that the exit handlers are not run.