diff options
author | Sven Eden <yamakuzure@gmx.net> | 2017-03-21 18:05:54 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-03-29 10:48:42 +0200 |
commit | cb29c0b51b66f934374908cd6a271786c69ca751 (patch) | |
tree | 8dbf38eeeb49fb6ef4a92ed2e6f0335375ad99ba /CODING_STYLE | |
parent | 1e2ea8296e947c80e2499c6f1e00912f4fadfc86 (diff) |
Update Build files
Diffstat (limited to 'CODING_STYLE')
-rw-r--r-- | CODING_STYLE | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/CODING_STYLE b/CODING_STYLE index f13f9becb..7fd4af8b8 100644 --- a/CODING_STYLE +++ b/CODING_STYLE @@ -311,3 +311,34 @@ always-true expression for an infinite while() loop is our recommendation is to simply write it without any such expression by using "for (;;)". + +- Never use the "off_t" type, and particularly avoid it in public + APIs. It's really weirdly defined, as it usually is 64bit and we + don't support it any other way, but it could in theory also be + 32bit. Which one it is depends on a compiler switch chosen by the + compiled program, which hence corrupts APIs using it unless they can + also follow the program's choice. Moreover, in systemd we should + parse values the same way on all architectures and cannot expose + off_t values over D-Bus. To avoid any confusion regarding conversion + and ABIs, always use simply uint64_t directly. + +- Commit message subject lines should be prefixed with an appropriate + component name of some kind. For example "journal: ", "nspawn: " and + so on. + +- Do not use "Signed-Off-By:" in your commit messages. That's a kernel + thing we don't do in the systemd project. + +- Avoid leaving long-running child processes around, i.e. fork()s that + are not followed quickly by an execv() in the child. Resource + management is unclear in this case, and memory CoW will result in + unexpected penalties in the parent much much later on. + +- Don't block execution for arbitrary amounts of time using usleep() + or a similar call, unless you really know what you do. Just "giving + something some time", or so is a lazy excuse. Always wait for the + proper event, instead of doing time-based poll loops. + +- To determine the length of a constant string "foo", don't bother + with sizeof("foo")-1, please use strlen("foo") directly. gcc knows + strlen() anyway and turns it into a constant expression if possible. |