mirror of
https://github.com/systemd/systemd.git
synced 2024-12-23 21:35:11 +03:00
Merge pull request #246 from smcv/xpg-not-xdg
Stop talking about the "XDG" version of basename()
This commit is contained in:
commit
afc4290e2c
@ -210,11 +210,12 @@
|
||||
c) recvmsg() must get MSG_CMSG_CLOEXEC set
|
||||
d) F_DUPFD_CLOEXEC should be used instead of F_DUPFD, and so on
|
||||
|
||||
- We never use the XDG version of basename(). glibc defines it in
|
||||
libgen.h. The only reason to include that file is because dirname()
|
||||
- We never use the POSIX version of basename() (which glibc defines it in
|
||||
libgen.h), only the GNU version (which glibc defines in string.h).
|
||||
The only reason to include libgen.h is because dirname()
|
||||
is needed. Everytime you need that please immediately undefine
|
||||
basename(), and add a comment about it, so that no code ever ends up
|
||||
using the XDG version!
|
||||
using the POSIX version!
|
||||
|
||||
- Use the bool type for booleans, not integers. One exception: in public
|
||||
headers (i.e those in src/systemd/sd-*.h) use integers after all, as "bool"
|
||||
|
@ -60,8 +60,8 @@
|
||||
#include <linux/fs.h>
|
||||
|
||||
/* When we include libgen.h because we need dirname() we immediately
|
||||
* undefine basename() since libgen.h defines it as a macro to the XDG
|
||||
* version which is really broken. */
|
||||
* undefine basename() since libgen.h defines it as a macro to the POSIX
|
||||
* version which is really broken. We prefer GNU basename(). */
|
||||
#include <libgen.h>
|
||||
#undef basename
|
||||
|
||||
|
@ -29,8 +29,8 @@
|
||||
#include <sys/prctl.h>
|
||||
|
||||
/* When we include libgen.h because we need dirname() we immediately
|
||||
* undefine basename() since libgen.h defines it as a macro to the XDG
|
||||
* version which is really broken. */
|
||||
* undefine basename() since libgen.h defines it as a macro to the POSIX
|
||||
* version which is really broken. We prefer GNU basename(). */
|
||||
#include <libgen.h>
|
||||
#undef basename
|
||||
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include <sys/mount.h>
|
||||
|
||||
/* When we include libgen.h because we need dirname() we immediately
|
||||
* undefine basename() since libgen.h defines it as a macro to the XDG
|
||||
* version which is really broken. */
|
||||
* undefine basename() since libgen.h defines it as a macro to the POSIX
|
||||
* version which is really broken. We prefer GNU basename(). */
|
||||
#include <libgen.h>
|
||||
#undef basename
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user