X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Freduce_features.c;h=183d798f7bd501b8b9eaed8e8ce9a58d52e43b69;hp=de817d655aa1342da22c2228ba55ac138cd58ba8;hb=758ab1f402b4af3cccac09548b709deca17ef930;hpb=0959991a0cae77bd404dee266aaf0667e51a459e diff --git a/tools/ccanlint/tests/reduce_features.c b/tools/ccanlint/tests/reduce_features.c index de817d65..183d798f 100644 --- a/tools/ccanlint/tests/reduce_features.c +++ b/tools/ccanlint/tests/reduce_features.c @@ -173,10 +173,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)))