Date: Thu, 27 May 2010 11:27:22 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 178877 for review Message-ID: <201005271127.o4RBRMLP030743@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@178877?ac=10 Change 178877 by gcooper@gcooper-bayonetta on 2010/05/27 11:26:31 Reorder fields for alignment, and properly capture and playback errors from read_plist. Affected files ... .. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/delete/perform.c#7 edit Differences ... ==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/delete/perform.c#7 (text+ko) ==== @@ -22,6 +22,8 @@ __FBSDID("$FreeBSD: src/usr.sbin/pkg_install/delete/perform.c,v 1.46 2010/04/23 11:07:43 flz Exp $"); #include <err.h> +#include <errno.h> + #include <pkg.h> #include "delete.h" @@ -122,19 +124,22 @@ static int pkg_do(char *pkg) { + PackingList p; + struct stat sb; + struct reqr_by_entry *rb_entry; + struct reqr_by_head *rb_list; char *deporigin, **deporigins = NULL, **depnames = NULL, ***depmatches, home[FILENAME_MAX]; - PackingList p; + const char *pre_script = DEINSTALL_FNAME; + const char *post_script, *pre_arg, *post_arg; int cfile; - int i, len; + int i; + int len; int isinstalled; /* support for separate pre/post install scripts */ int new_m = 0, dep_count = 0; - const char *pre_script = DEINSTALL_FNAME; - const char *post_script, *pre_arg, *post_arg; - struct reqr_by_entry *rb_entry; - struct reqr_by_head *rb_list; int fd; - struct stat sb; + int rc; + int serrno; if (!pkg || !(len = strlen(pkg))) return 1; @@ -213,8 +218,13 @@ /* If we have a prefix, add it now */ if (Prefix) add_plist(&Plist, PLIST_CWD, Prefix); - read_plist(&Plist, cfile); + rc = read_plist(&Plist, cfile); + serrno = errno; (void) close(cfile); + if (rc == -1) { + warnx("error occurred when reading plist: %s", strerror(serrno)); + return 1; + } p = find_plist(&Plist, PLIST_CWD); if (!p) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005271127.o4RBRMLP030743>