CODING_STYLE revision debf93a4d6d691d8904e7f485ac6579844abadf4
ee9c9500ab13c1093fc3feaf2aa5a0d330d0bfadKay Sievers
19aadacf92ad86967ffb678e37b2ff9e83cb9480Jan Engelhardt- 8ch indent, no tabs
cff452c7e974db5053cdbd0d7bbbab2e3b4c91b9Kay Sievers
cff452c7e974db5053cdbd0d7bbbab2e3b4c91b9Kay Sievers- structs in MixedCase, variables, functions in lower_case
cff452c7e974db5053cdbd0d7bbbab2e3b4c91b9Kay Sievers
cff452c7e974db5053cdbd0d7bbbab2e3b4c91b9Kay Sievers- the destructors always unregister the object from the next bigger
7c66aeba0f28cb82027d6015405ed71afa3b6059Kay Sievers object, not the other way around
7c66aeba0f28cb82027d6015405ed71afa3b6059Kay Sievers
c904f64d84db8c4eebedf210ba10893f19ba05edLennart Poettering- to minimize strict aliasing violations we prefer unions over casting
c904f64d84db8c4eebedf210ba10893f19ba05edLennart Poettering
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers- for robustness reasons destructors should be able to destruct
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers half-initialized objects, too
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers
f957632b960a0a42999b38ded7089fa602b41745Kay Sievers- error codes are returned as negative Exxx. i.e. return -EINVAL. There
a40593a0d0d740efa387e35411e1e456a6c5aba7Lennart Poettering are some exceptions: for constructors its is OK to return NULL on
20ffc4c4a9226b0e45cc02ad9c0108981626c0bbKay Sievers OOM. For lookup functions NULL is fine too for "not found".
19aadacf92ad86967ffb678e37b2ff9e83cb9480Jan Engelhardt
ea92ae33e0fbbf8a98cd2e08ca5a850d83d57faeMaciej Wereski- Do not issue NSS requests (that includes user name and host name
ea92ae33e0fbbf8a98cd2e08ca5a850d83d57faeMaciej Wereski lookups) from the main daemon as this might trigger deadlocks when
04ac799283f517672a5424e7c5bf066cfa4ca020Zbigniew Jędrzejewski-Szmek we those lookups involve synchronously talking to services that we
04ac799283f517672a5424e7c5bf066cfa4ca020Zbigniew Jędrzejewski-Szmek would need to start up.
04ac799283f517672a5424e7c5bf066cfa4ca020Zbigniew Jędrzejewski-Szmek
04ac799283f517672a5424e7c5bf066cfa4ca020Zbigniew Jędrzejewski-Szmek- Do not acccess any directories outside of /etc/, /dev, /lib from the
466784c8710e5cb0e0b86a16506d992d7ec5b619Kay Sievers init daemon to avoid deadlocks with the automounter.
3679d1126bae52e02f6cd60fca196f616b9e660dLennart Poettering
dc7adf202b82fc0054c457ce6ca3bcedb88dde57Lennart Poettering- Don't synchronously talk to any other service, due to risk of
7b4da18c1717f811bae67ea3d39290495857c03eLennart Poettering deadlocks.
81d112a8f0522a09fcfe317f420363a2b728137cLennart Poettering