From owner-p4-projects@FreeBSD.ORG Fri May 28 11:25:24 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DDA181065676; Fri, 28 May 2010 11:25:23 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1D311065673 for ; Fri, 28 May 2010 11:25:23 +0000 (UTC) (envelope-from gcooper@FreeBSD.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 8FBE08FC21 for ; Fri, 28 May 2010 11:25:23 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o4SBPN9S028790 for ; Fri, 28 May 2010 11:25:23 GMT (envelope-from gcooper@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o4SBPNUi028788 for perforce@freebsd.org; Fri, 28 May 2010 11:25:23 GMT (envelope-from gcooper@FreeBSD.org) Date: Fri, 28 May 2010 11:25:23 GMT Message-Id: <201005281125.o4SBPNUi028788@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gcooper@FreeBSD.org using -f From: Garrett Cooper To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 178921 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 May 2010 11:25:24 -0000 http://p4web.freebsd.org/@@178921?ac=10 Change 178921 by gcooper@gcooper-bayonetta on 2010/05/28 11:24:43 Catch the last read_plist uncaught exception. Affected files ... .. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/info/perform.c#10 edit Differences ... ==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/info/perform.c#10 (text+ko) ==== @@ -190,7 +190,8 @@ serrno = errno; (void) close(fd); if (rc == -1) - errx(EXIT_FAILURE, "failure reading plist: %s", strerror(serrno)); + errx(EXIT_FAILURE, "failure occurred reading plist: %s", + strerror(serrno)); /* * Index is special info type that has to override all others to make @@ -342,9 +343,12 @@ static int find_pkg(struct which_head *which_list) { + struct which_entry *wp; char **installed; - int errcode, i; - struct which_entry *wp; + int errcode; + int i; + int rc; + int serrno; TAILQ_FOREACH(wp, which_list, next) { const char *msg = "file cannot be found"; @@ -394,8 +398,12 @@ } pkg.head = pkg.tail = NULL; - read_plist(&pkg, fd); - close(fd); + rc = read_plist(&pkg, fd); + serrno = errno; + (void) close(fd); + if (rc == -1) + errx(EXIT_FAILURE, "failure occurred reading plist: %s", + strerror(serrno)); for (itr = pkg.head; itr != pkg.tail; itr = itr->next) { if (itr->type == PLIST_CWD) { cwd = itr->name;