summaryrefslogtreecommitdiff
path: root/net/fetch
diff options
context:
space:
mode:
authorjoerg <joerg>2011-11-13 23:11:26 +0000
committerjoerg <joerg>2011-11-13 23:11:26 +0000
commit3f66d9ba2194dd5f4b0e95cddcb993d0603242ac (patch)
treee3aa9f65b9df538060bd33a78339b0975749fe5b /net/fetch
parent24863100a417004f26337fd79d96753f7277ff2f (diff)
downloadpkgsrc-3f66d9ba2194dd5f4b0e95cddcb993d0603242ac.tar.gz
Add a bunch of checks to make gcc with glibc happy
Diffstat (limited to 'net/fetch')
-rw-r--r--net/fetch/files/fetch.c10
1 files changed, 8 insertions, 2 deletions
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);