Date: Fri, 28 May 2010 11:25:23 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 178921 for review Message-ID: <201005281125.o4SBPNUi028788@repoman.freebsd.org>
index | next in thread | raw e-mail
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;help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005281125.o4SBPNUi028788>
