Browse Source

tar: don't complain when directory exists

K. Lange 2 years ago
parent
commit
89d654e233
1 changed files with 3 additions and 1 deletions
  1. 3 1
      apps/tar.c

+ 3 - 1
apps/tar.c

@@ -251,7 +251,9 @@ int main(int argc, char * argv[]) {
 					}
 					if (strlen(name)) {
 						if (mkdir(name, 0777) < 0) {
-							fprintf(stderr, "%s: %s: %s: %s\n", argv[0], fname, name, strerror(errno));
+							if (errno != EEXIST) {
+								fprintf(stderr, "%s: %s: %s: %s\n", argv[0], fname, name, strerror(errno));
+							}
 						}
 					}
 				} else if (file->type[0] == '1') {