chiark / gitweb /
CODING_STYLE: clarify that exit() is never OK to call
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Apr 2015 10:14:43 +0000 (12:14 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Apr 2015 10:17:41 +0000 (12:17 +0200)
CODING_STYLE

index b687e729f4676c3c91ce054eeced49322a4e339f..1748dc4bc4d705e33dcf9ac43bac64a8f7727569 100644 (file)
   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.