X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Freduce_features.c;h=39a2bde067a96dbc0072514f5633eebff39974aa;hp=aaeba75170f78a7b33b60355f97292c7b7c61908;hb=939fab341caaa06d032b29f06362335de0db82cc;hpb=728d98e8e44abcacbe9bfcd89762de2beda72698 diff --git a/tools/ccanlint/tests/reduce_features.c b/tools/ccanlint/tests/reduce_features.c index aaeba751..39a2bde0 100644 --- a/tools/ccanlint/tests/reduce_features.c +++ b/tools/ccanlint/tests/reduce_features.c @@ -160,11 +160,14 @@ static void do_reduce_features(struct manifest *m, hdr = talloc_asprintf_append (hdr, "#undef %s\n#define %s 0\n", sym, sym); } - fd = open("config.h", O_EXCL|O_CREAT|O_RDWR, 0600); + if (mkdir("reduced-features", 0700) != 0) + err(1, "Creating reduced-features directory"); + + fd = open("reduced-features/config.h", O_EXCL|O_CREAT|O_RDWR, 0600); if (fd < 0) - err(1, "Creating config.h"); + err(1, "Creating reduced-features/config.h"); if (!write_all(fd, hdr, strlen(hdr))) - err(1, "Writing config.h"); + err(1, "Writing reduced-features/config.h"); close(fd); features_were_reduced = true; }