tar: Use remove() instead of unlink() so we can work on directories too
This commit is contained in:
parent
3419f94d83
commit
fb1595a69c
2
tar.c
2
tar.c
|
@ -201,7 +201,7 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
|
|||
|
||||
if (!mflag && ((mtime = strtol(h->mtime, &p, 8)) < 0 || *p != '\0'))
|
||||
eprintf("strtol %s: invalid number\n", h->mtime);
|
||||
if (unlink(fname) < 0 && errno != ENOENT && errno != EISDIR)
|
||||
if (remove(fname) < 0 && errno != ENOENT)
|
||||
eprintf("unlink %s:", fname);
|
||||
|
||||
tmp = estrdup(fname);
|
||||
|
|
Loading…
Reference in New Issue
Block a user