PERFORCE change 178097 for review
    Garrett Cooper 
    gcooper at FreeBSD.org
       
    Tue May 11 14:44:02 UTC 2010
    
    
  
http://p4web.freebsd.org/@@178097?ac=10
Change 178097 by gcooper at starr on 2010/05/11 14:44:01
	Fix the error catch with a archive_write_new failure, and make sure that we actually truncate any existing files if Regenerate is TRUE.
Affected files ...
.. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#11 edit
Differences ...
==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#11 (text+ko) ====
@@ -403,8 +403,10 @@
 
 	archive_open_flags = O_WRONLY;
 
-	if (Regenerate == FALSE)
-		archive_open_flags |= O_CREAT;
+        if (Regenerate == TRUE)
+                archive_open_flags |= O_TRUNC;
+        else
+                archive_open_flags |= O_CREAT;
 
 	/* 
 	 * NOTE (gcooper): No sense in calloc'ing destfile or srcfile as the
@@ -425,7 +427,7 @@
 			warn("Skipping package creation for: '%s'", tball);
 	}
 	else if ((archive = archive_write_new()) == NULL)
-		error = archive_error_string(archive);
+		error = strerror(errno);
 	else if (archive_write_set_format_ustar(archive) != ARCHIVE_OK)
 		error = archive_error_string(archive);
 	else {
    
    
More information about the p4-projects
mailing list