X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fexamples_exist.c;h=61359596e1f693ed56a127c613724462e1f1f2d7;hp=c42a2e4e9ff27c5f183b498e798c3ae10a1e238f;hb=HEAD;hpb=c5a49e4942e98f17744f2a50dead077b34d0ceaf diff --git a/tools/ccanlint/tests/examples_exist.c b/tools/ccanlint/tests/examples_exist.c index c42a2e4e..61359596 100644 --- a/tools/ccanlint/tests/examples_exist.c +++ b/tools/ccanlint/tests/examples_exist.c @@ -45,7 +45,10 @@ static char *add_example(struct manifest *m, struct ccan_file *source, /* Add #line to demark where we are from, so errors are correct! */ linemarker = tal_fmt(f, "#line %i \"%s\"\n", example->srcline+2, source->fullname); - write(fd, linemarker, strlen(linemarker)); + if (write(fd, linemarker, strlen(linemarker)) != (int)strlen(linemarker)) { + close(fd); + return cast_const(char *, "Failure writing to temporary file"); + } for (i = 0; i < example->num_lines; i++) { if (write(fd, example->lines[i], strlen(example->lines[i])) @@ -62,7 +65,7 @@ static char *add_example(struct manifest *m, struct ccan_file *source, /* FIXME: We should have one example per function in header. */ static void extract_examples(struct manifest *m, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { struct ccan_file *f, *mainh = NULL; /* gcc complains uninitialized */