PERFORCE change 178921 for review

Garrett Cooper gcooper at FreeBSD.org
Fri May 28 11:25:24 UTC 2010


http://p4web.freebsd.org/@@178921?ac=10

Change 178921 by gcooper at 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;


More information about the p4-projects mailing list