From owner-svn-src-head@FreeBSD.ORG Sat Jun 5 12:49:39 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4A6510656E8; Sat, 5 Jun 2010 12:49:39 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (unknown [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9432F8FC15; Sat, 5 Jun 2010 12:49:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o55Cndh4027386; Sat, 5 Jun 2010 12:49:39 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o55CndPA027384; Sat, 5 Jun 2010 12:49:39 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201006051249.o55CndPA027384@svn.freebsd.org> From: Edwin Groothuis Date: Sat, 5 Jun 2010 12:49:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r208830 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2010 12:49:39 -0000 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");