projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f103f73
)
configurator: test for HAVE_FCHDIR
author
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 22 Nov 2012 01:12:25 +0000
(11:42 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 22 Nov 2012 01:12:25 +0000
(11:42 +1030)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/configurator/configurator.c
patch
|
blob
|
history
diff --git
a/tools/configurator/configurator.c
b/tools/configurator/configurator.c
index eb4728462eab451a9785836b0cc7cb99b79de318..143069074ff4c74d222c8a48df061daf9b5d0794 100644
(file)
--- a/
tools/configurator/configurator.c
+++ b/
tools/configurator/configurator.c
@@
-146,6
+146,15
@@
static struct test tests[] = {
{ "HAVE_COMPOUND_LITERALS", INSIDE_MAIN, NULL, NULL,
"int *foo = (int[]) { 1, 2, 3, 4 };\n"
"return foo[0] ? 0 : 1;" },
+ { "HAVE_FCHDIR", DEFINES_EVERYTHING|EXECUTE, NULL, NULL,
+ "#include <sys/types.h>\n"
+ "#include <sys/stat.h>\n"
+ "#include <fcntl.h>\n"
+ "#include <unistd.h>\n"
+ "int main(void) {\n"
+ " int fd = open(\"..\", O_RDONLY);\n"
+ " return fchdir(fd) == 0 ? 0 : 1;\n"
+ "}\n" },
{ "HAVE_ERR_H", DEFINES_FUNC, NULL, NULL,
"#include <err.h>\n"
"static void func(int arg) {\n"