projects
/
ccan
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1ddb742
)
ccanlint: check unused result.
author
Rusty Russell
<rusty@rustcorp.com.au>
Sun, 6 Nov 2016 06:42:53 +0000
(17:12 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Sun, 6 Nov 2016 06:42:53 +0000
(17:12 +1030)
GCC with -O gives an error here.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/ccanlint/tests/examples_exist.c
patch
|
blob
|
history
diff --git
a/tools/ccanlint/tests/examples_exist.c
b/tools/ccanlint/tests/examples_exist.c
index 19d61a89e3a058135495c607dc2b733b1c15ecba..61359596e1f693ed56a127c613724462e1f1f2d7 100644
(file)
--- 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]))