svn commit: r241017 - stable/8/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: 241017
URL: http://svn.freebsd.org/changeset/base/241017

Log:
  MFC r240495:
  	Adding missing return statements during error conditions.
  
  PR:		kern/171187
  Approved by:	cperciva (implicit)

Modified:
  stable/8/lib/libfetch/file.c
Directory Properties:
  stable/8/lib/libfetch/   (props changed)

Modified: stable/8/lib/libfetch/file.c
==============================================================================
--- stable/8/lib/libfetch/file.c	Fri Sep 28 01:04:09 2012	(r241016)
+++ stable/8/lib/libfetch/file.c	Fri Sep 28 01:04:09 2012	(r241017)
@@ -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-all mailing list