Without this flag, compilation fails with:
hgclient.c: In function 'hgc_open':
hgclient.c:466: error: 'O_DIRECTORY' undeclared (first use in this function)
hgclient.c:466: error: (Each undeclared identifier is reported only once
hgclient.c:466: error: for each function it appears in.)
Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG5544af862286: chg: define _GNU_SOURCE to allow CentOS 5 compilation
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Looks good. The manpage says
The O_CLOEXEC, O_DIRECTORY, and O_NOFOLLOW flags are not specified in POSIX.1-2001, but are specified in
POSIX.1-2008. Since glibc 2.12, one can obtain their definitions by defining either _POSIX_C_SOURCE with
a value greater than or equal to 200809L or _XOPEN_SOURCE with a value greater than or equal to 700. In
glibc 2.11 and earlier, one obtains the definitions by defining _GNU_SOURCE.
and the compiler error appears to be included in the commit message.