Date: Sun, 9 May 2010 00:25:25 GMT From: Garrett Cooper <gcooper@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 177985 for review Message-ID: <201005090025.o490PP7S086483@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@177985?ac=10 Change 177985 by gcooper@gcooper-bayonetta on 2010/05/09 00:24:45 - Convert trailing hard tabs in ADD_FILE to spaces for readability in diffs. - Remove an unused constant. Affected files ... .. //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#6 edit Differences ... ==== //depot/projects/soc2007/gcooper-pkg_install-enhancements-simplified/usr.sbin/pkg_install/create/perform.c#6 (text+ko) ==== @@ -343,43 +343,39 @@ return TRUE; /* Success */ } -#define COMPRESS_ARCHIVE_FLAGS (ARCHIVE_EXTRACT_OWNER |ARCHIVE_EXTRACT_PERM| \ - ARCHIVE_EXTRACT_TIME |ARCHIVE_EXTRACT_ACL | \ - ARCHIVE_EXTRACT_FFLAGS|ARCHIVE_EXTRACT_XATTR) - static void make_dist(const char *homedir, const char *pkg, const char *suff, Package *plist) { -#define ADD_FILE(src_file, dest_file) \ - if (error == NULL) { \ - if ((archive_entry_fd = open(src_file, \ - archive_entry_fd)) == -1 || \ - fstat(archive_entry_fd, sb) == -1) { \ - error = strerror(errno); \ - } else if ((archive_entry_map_addr = mmap(NULL, \ - PROT_READ, sb->st_size, MAP_SHARED, \ - archive_entry_fd, 0)) == NULL) { \ - error = strerror(errno); \ - } else { \ - if ((entry = archive_entry_new()) == NULL) \ - error = archive_error_string(archive); \ - else { \ - archive_entry_copy_stat(entry, sb); \ - if (archive_write_header(archive, \ - entry) != ARCHIVE_OK) \ - error = archive_error_string(archive); \ - else if (archive_write_data(archive, \ - archive_entry_map_addr, \ - sb->st_size) != ARCHIVE_OK) \ - error = archive_error_string(archive); \ - (void) munmap(archive_entry_map_addr, \ - sb->st_size); \ - archive_entry_free(entry); \ - } \ - } \ - if (0 <= archive_entry_fd) \ - close(archive_entry_fd); \ +#define ADD_FILE(src_file, dest_file) \ + if (error == NULL) { \ + if ((archive_entry_fd = open(src_file, \ + archive_entry_fd)) == -1 || \ + fstat(archive_entry_fd, sb) == -1) { \ + error = strerror(errno); \ + } else if ((archive_entry_map_addr = mmap(NULL, \ + PROT_READ, sb->st_size, MAP_SHARED, \ + archive_entry_fd, 0)) == NULL) { \ + error = strerror(errno); \ + } else { \ + if ((entry = archive_entry_new()) == NULL) \ + error = archive_error_string(archive); \ + else { \ + archive_entry_copy_stat(entry, sb); \ + if (archive_write_header(archive, \ + entry) != ARCHIVE_OK) \ + error = archive_error_string(archive);\ + else if (archive_write_data(archive, \ + archive_entry_map_addr, \ + sb->st_size) != ARCHIVE_OK) \ + error = archive_error_string(archive);\ + (void) munmap(archive_entry_map_addr, \ + sb->st_size); \ + archive_entry_free(entry); \ + } \ + } \ + if (0 <= archive_entry_fd) \ + close(archive_entry_fd); \ } #if NOTYET
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005090025.o490PP7S086483>