Add a bunch of checks to make gcc with glibc happy

This commit is contained in:
joerg 2011-11-13 23:11:26 +00:00
parent 80afa9e068
commit 38c64c4d4c

View file

@ -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);