summaryrefslogtreecommitdiff
path: root/busybox/busybox-1.00-rc1/tar.patch
blob: e0802751840da9fcf3d9a62a053ebb50ab2a114a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- busybox/archival/libunarchive/data_extract_all.c	2002-11-29 01:43:46.000000000 -0500
+++ busybox-new/archival/libunarchive/data_extract_all.c	2002-12-03 18:38:21.000000000 -0500
@@ -69,6 +68,9 @@
 		case S_IFLNK:
 			/* Symlink */
 			res = symlink(file_header->link_name, file_header->name);
+			if ((res == -1) && (errno == EEXIST) && (unlink(file_header->name) == 0)) {
+				res = symlink(file_header->link_name, file_header->name);
+			}
 			if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
 				perror_msg("Cannot create symlink from %s to '%s'", file_header->name, file_header->link_name);
 			}
@@ -78,6 +80,9 @@
 		case S_IFCHR:
 		case S_IFIFO:
 			res = mknod(file_header->name, file_header->mode, file_header->device);
+			if ((res == -1) && (errno == EEXIST) && (unlink(file_header->name) == 0)) {
+				res = mknod(file_header->name, file_header->mode, file_header->device);
+			}
 			if ((res == -1) && !(archive_handle->flags & ARCHIVE_EXTRACT_QUIET)) {
 				perror_msg("Cannot create node %s", file_header->name);
 			}