summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-06-12 09:54:09 +0000
committerRoy Marples <roy@marples.name>2015-06-12 09:54:09 +0000
commit32897869f1afd4bd2c6d943ee65d21492856048b (patch)
tree03bb747eb543ff4ae3078c0ceb634765f066c41d /ipv6.c
parenta175f2b7dd90b2df00f78fef07d0d145101e2289 (diff)
downloaddhcpcd-32897869f1afd4bd2c6d943ee65d21492856048b.tar.xz
Check fclose(3) writes correctly, thanks to Bob.
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipv6.c b/ipv6.c
index 00d74b46..2db5816c 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -251,7 +251,8 @@ ipv6_readsecret(struct dhcpcd_ctx *ctx)
goto eexit;
x = fprintf(fp, "%s\n",
hwaddr_ntoa(ctx->secret, ctx->secret_len, line, sizeof(line)));
- fclose(fp);
+ if (fclose(fp) == EOF)
+ x = -1;
if (x > 0)
return (ssize_t)ctx->secret_len;