chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4ac4d1
)
CODING_STYLE: clarify that exit() is never OK to call
author
Lennart Poettering
<lennart@poettering.net>
Thu, 2 Apr 2015 10:14:43 +0000
(12:14 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 2 Apr 2015 10:17:41 +0000
(12:17 +0200)
CODING_STYLE
patch
|
blob
|
history
diff --git
a/CODING_STYLE
b/CODING_STYLE
index b687e729f4676c3c91ce054eeced49322a4e339f..1748dc4bc4d705e33dcf9ac43bac64a8f7727569 100644
(file)
--- 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.