svn commit: r240495 - head/lib/libfetch
Eitan Adler
eadler at FreeBSD.org
Fri Sep 14 12:15:14 UTC 2012
Author: eadler
Date: Fri Sep 14 12:15:13 2012
New Revision: 240495
URL: http://svn.freebsd.org/changeset/base/240495
Log:
Adding missing return statements during error conditions.
PR: kern/171187
Submitted by: Mark Johnston <markjdb at gmail.com>
Reviewed by: des
Approved by: cperciva
MFC after: 2 weeks
Modified:
head/lib/libfetch/file.c
Modified: head/lib/libfetch/file.c
==============================================================================
--- head/lib/libfetch/file.c Fri Sep 14 11:51:49 2012 (r240494)
+++ head/lib/libfetch/file.c Fri Sep 14 12:15:13 2012 (r240495)
@@ -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-head
mailing list