]> git.ipfire.org Git - people/ms/systemd.git/blame - CODING_STYLE
execute: typo fix
[people/ms/systemd.git] / CODING_STYLE
CommitLineData
60918275
LP
1
2- 8ch indent, no tabs
3
4- structs in MixedCase, variables, functions in lower_case
5
6- the destructors always unregister the object from the next bigger
7 object, not the other way around
8
9- to minimize strict aliasing violations we prefer unions over casting
10
11- for robustness reasons destructors should be able to destruct
12 half-initialized objects, too
13
e1cc7a01 14- error codes are returned as negative Exxx. i.e. return -EINVAL. There
60918275
LP
15 are some exceptions: for constructors its is OK to return NULL on
16 OOM. For lookup functions NULL is fine too for "not found".
debf93a4
LP
17
18- Do not issue NSS requests (that includes user name and host name
19 lookups) from the main daemon as this might trigger deadlocks when
20 we those lookups involve synchronously talking to services that we
21 would need to start up.
22
23- Do not acccess any directories outside of /etc/, /dev, /lib from the
24 init daemon to avoid deadlocks with the automounter.
25
26- Don't synchronously talk to any other service, due to risk of
27 deadlocks.