mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(wipename): Work even if the directory is writeable
and not readable. Prefer write access, since this should work better with fdatasync.
This commit is contained in:
1 parent
e077b28593
commit
1def589bea
1 file changed
+4
-1
+4
-1
@@ -1434,10 +1434,13 @@ wipename (char *oldname, char const *qoldname, struct Options const *flags)
|
||||
size_t len = base_len (base);
|
||||
char *dir = dir_name (newname);
|
||||
char *qdir = xstrdup (quotearg_colon (dir));
|
||||
int dir_fd = open (dir, O_RDONLY | O_NOCTTY);
|
||||
bool first = true;
|
||||
bool ok = true;
|
||||
|
||||
int dir_fd = open (dir, O_WRONLY | O_NOCTTY);
|
||||
if (dir_fd < 0)
|
||||
dir_fd = open (dir, O_RDONLY | O_NOCTTY);
|
||||
|
||||
if (flags->verbose)
|
||||
error (0, 0, _("%s: removing"), qoldname);
|
||||
|
||||
|
||||
Reference in new issue
Block a user