PERFORCE change 178147 for review
Garrett Cooper
gcooper at FreeBSD.org
Wed May 12 15:54:23 UTC 2010
http://p4web.freebsd.org/@@178147?ac=10
Change 178147 by gcooper at starr-bastion on 2010/05/12 15:53:44
Fix an uncaught error when open(2) fails. Fix some bass ackwards inverted logic while I'm here.
Affected files ...
.. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#19 edit
Differences ...
==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#19 (text+ko) ====
@@ -425,10 +425,8 @@
* If the package tarball exists already, and we are running in
* `no clobber' mode, skip this package.
*/
- else if ((archive_fd = open(tball, archive_open_flags)) == -1) {
- if (Verbose)
- warn("Skipping package creation for: '%s'", tball);
- }
+ else if ((archive_fd = open(tball, archive_open_flags)) == -1)
+ error = strerror(errno);
else if ((archive = archive_write_new()) == NULL)
error = strerror(errno);
else if (archive_write_set_format_ustar(archive) != ARCHIVE_OK)
@@ -477,10 +475,10 @@
}
- if (error != NULL &&
+ if (error == NULL &&
archive_write_open_fd(archive, archive_fd) != ARCHIVE_OK)
error = archive_error_string(archive);
- if (error != NULL) {
+ if (error == NULL) {
if (Verbose)
printf("Creating %sed tar ball in '%s'\n",
@@ -537,7 +535,7 @@
PATH_MAX)
error = strerror(ENAMETOOLONG);
- if (error != NULL)
+ if (error == NULL)
if (strlcat(destfile, p->name, PATH_MAX) >
PATH_MAX)
error = strerror(ENAMETOOLONG);
@@ -548,7 +546,7 @@
PATH_MAX) > PATH_MAX)
error = strerror(ENAMETOOLONG);
- if (error != NULL)
+ if (error == NULL)
if (strlcat(srcfile, p->name, PATH_MAX) >
PATH_MAX)
error = strerror(ENAMETOOLONG);
More information about the p4-projects
mailing list