Date: Sat, 5 Jun 2010 12:49:39 +0000 (UTC) From: Edwin Groothuis <edwin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208830 - head/usr.sbin/tzsetup Message-ID: <201006051249.o55CndPA027384@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006051249.o55CndPA027384>