svn commit: r208830 - head/usr.sbin/tzsetup

Edwin Groothuis edwin at FreeBSD.org
Sat Jun 5 12:49:39 UTC 2010


Author: edwin
Date: Sat Jun  5 12:49:39 2010
New Revision: 208830
URL: http://svn.freebsd.org/changeset/base/208830

Log:
  When there is a problem with writing, also bail out.
  
  Found with the clang checker.

Modified:
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- head/usr.sbin/tzsetup/tzsetup.c	Sat Jun  5 12:31:08 2010	(r208829)
+++ head/usr.sbin/tzsetup/tzsetup.c	Sat Jun  5 12:49:39 2010	(r208830)
@@ -564,7 +564,8 @@ install_zoneinfo_file(const char *zonein
 			}
 
 			while ((len = read(fd1, buf, sizeof(buf))) > 0)
-				len = write(fd2, buf, len);
+				if ((len = write(fd2, buf, len)) < 0)
+					break;
 
 			if (len == -1) {
 				snprintf(title, sizeof(title), "Error");


More information about the svn-src-head mailing list