]> git.ipfire.org Git - people/ms/systemd.git/blob - CODING_STYLE
manager: fix GC algorithm
[people/ms/systemd.git] / CODING_STYLE
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
14 - error codes are returned as negative Exxx. i.e. return -EINVAL. There
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".
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.