diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-20 18:49:47 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-20 18:49:47 +0400 |
commit | 75103841072d71603b49ad00648e204ffcca589d (patch) | |
tree | c07868b07df1b0aa5889fab67d7fafdb7eb40870 /archival/libunarchive/get_header_cpio.c | |
parent | 761ce14fd266d8bf78b8f9c83ec2425ede0648b9 (diff) |
do not do utime() on links, it acts on link targets, and we don't want that.
rename link_name to link_target, less confusing this way.
Diffstat (limited to 'archival/libunarchive/get_header_cpio.c')
-rw-r--r-- | archival/libunarchive/get_header_cpio.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index 6fd134018..724368be2 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c @@ -30,7 +30,7 @@ char get_header_cpio(archive_handle_t *archive_handle) tmp = saved_hardlinks; oldtmp = NULL; - file_header->link_name = file_header->name; + file_header->link_target = file_header->name; file_header->size = 0; while (tmp) { @@ -56,7 +56,7 @@ char get_header_cpio(archive_handle_t *archive_handle) saved_hardlinks = tmp; } - file_header->name = file_header->link_name; + file_header->name = file_header->link_target; if (pending_hardlinks > 1) { bb_error_msg("error resolving hardlink: archive made by GNU cpio 2.0-2.2?"); @@ -122,12 +122,12 @@ char get_header_cpio(archive_handle_t *archive_handle) } if (S_ISLNK(file_header->mode)) { - file_header->link_name = xzalloc(file_header->size + 1); - xread(archive_handle->src_fd, file_header->link_name, file_header->size); + file_header->link_target = xzalloc(file_header->size + 1); + xread(archive_handle->src_fd, file_header->link_target, file_header->size); archive_handle->offset += file_header->size; file_header->size = 0; /* Stop possible seeks in future */ } else { - file_header->link_name = NULL; + file_header->link_target = NULL; } if (nlink > 1 && !S_ISDIR(file_header->mode)) { if (file_header->size == 0) { /* Put file on a linked list for later */ @@ -154,7 +154,7 @@ char get_header_cpio(archive_handle_t *archive_handle) archive_handle->offset += file_header->size; - free(file_header->link_name); + free(file_header->link_target); return EXIT_SUCCESS; } |