X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Freduce_features.c;h=6b4bd1571a857e97a09dbb7b0cbb559fb14b5d5d;hp=de817d655aa1342da22c2228ba55ac138cd58ba8;hb=87c679ff36d7b198862cd2652a384d90f89f3b2b;hpb=0c3590dc33d644f73bb8587db454c491830aaf26 diff --git a/tools/ccanlint/tests/reduce_features.c b/tools/ccanlint/tests/reduce_features.c index de817d65..6b4bd157 100644 --- a/tools/ccanlint/tests/reduce_features.c +++ b/tools/ccanlint/tests/reduce_features.c @@ -129,7 +129,6 @@ static struct htable_option *get_config_options(struct manifest *m) } static void do_reduce_features(struct manifest *m, - bool keep, unsigned int *timeleft, struct score *score) { struct htable_option *options_used, *options_avail, *options; @@ -173,10 +172,10 @@ static void do_reduce_features(struct manifest *m, hdr = talloc_asprintf_append (hdr, "#undef %s\n#define %s 0\n", sym, sym); } - if (mkdir("reduced-features", 0700) != 0) + if (mkdir("reduced-features", 0700) != 0 && errno != EEXIST) err(1, "Creating reduced-features directory"); - fd = open("reduced-features/config.h", O_EXCL|O_CREAT|O_RDWR, 0600); + fd = open("reduced-features/config.h", O_TRUNC|O_CREAT|O_RDWR, 0600); if (fd < 0) err(1, "Creating reduced-features/config.h"); if (!write_all(fd, hdr, strlen(hdr)))