svn commit: r241016 - stable/9/lib/libfetch
Eitan Adler
eadler at FreeBSD.org
Fri Sep 28 01:04:10 UTC 2012
Author: eadler
Date: Fri Sep 28 01:04:09 2012
New Revision: 241016
URL: http://svn.freebsd.org/changeset/base/241016
Log:
MFC r240495:
Adding missing return statements during error conditions.
PR: kern/171187
Approved by: cperciva (implicit)
Modified:
stable/9/lib/libfetch/file.c
Directory Properties:
stable/9/lib/libfetch/ (props changed)
Modified: stable/9/lib/libfetch/file.c
==============================================================================
--- stable/9/lib/libfetch/file.c Thu Sep 27 23:31:19 2012 (r241015)
+++ stable/9/lib/libfetch/file.c Fri Sep 28 01:04:09 2012 (r241016)
@@ -50,12 +50,15 @@ fetchXGetFile(struct url *u, struct url_
f = fopen(u->doc, "r");
- if (f == NULL)
+ if (f == NULL) {
fetch_syserr();
+ return (NULL);
+ }
if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) {
fclose(f);
fetch_syserr();
+ return (NULL);
}
fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
@@ -78,12 +81,15 @@ fetchPutFile(struct url *u, const char *
else
f = fopen(u->doc, "w+");
- if (f == NULL)
+ if (f == NULL) {
fetch_syserr();
+ return (NULL);
+ }
if (u->offset && fseeko(f, u->offset, SEEK_SET) == -1) {
fclose(f);
fetch_syserr();
+ return (NULL);
}
fcntl(fileno(f), F_SETFD, FD_CLOEXEC);
More information about the svn-src-stable-9
mailing list