From: Lennart Poettering Date: Thu, 2 Apr 2015 10:14:43 +0000 (+0200) Subject: CODING_STYLE: clarify that exit() is never OK to call X-Git-Tag: v219.0~198 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3dbafa39b08025350e7b17f4874a343c789ff9b3;p=elogind.git CODING_STYLE: clarify that exit() is never OK to call --- diff --git a/CODING_STYLE b/CODING_STYLE index b687e729f..1748dc4bc 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -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.