From e9b9ab941f9671c03ba13c11c9fd06e94e957dba Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 13 Nov 2011 23:11:26 +0000 Subject: Add a bunch of checks to make gcc with glibc happy --- net/fetch/files/fetch.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'net/fetch') diff --git a/net/fetch/files/fetch.c b/net/fetch/files/fetch.c index d29b188985c..6ae1df44a75 100644 --- a/net/fetch/files/fetch.c +++ b/net/fetch/files/fetch.c @@ -668,8 +668,14 @@ fetch(char *URL, const char *path) warn("%s: mkstemp failed", tmppath); goto failure; } - fchown(fd, sb.st_uid, sb.st_gid); - fchmod(fd, sb.st_mode & ALLPERMS); + if (fchown(fd, sb.st_uid, sb.st_gid) == -1) { + warn("%s: mkstemp failed", tmppath); + goto failure; + } + if (fchmod(fd, sb.st_mode & ALLPERMS) == -1) { + warn("%s: mkstemp failed", tmppath); + goto failure; + } of = fdopen(fd, "w"); if (of == NULL) { close(fd); -- cgit v1.2.3