projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40ea51a
)
(wipename): Use similar open flags to other places we open directories.
author
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 27 Dec 2005 08:00:12 +0000
(08:00 +0000)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 27 Dec 2005 08:00:12 +0000
(08:00 +0000)
Don't bother trying to open dir for writing, since POSIX prohibits it.
src/shred.c
patch
|
blob
|
history
diff --git
a/src/shred.c
b/src/shred.c
index
3e47aad
..
fdcc54d
100644
(file)
--- a/
src/shred.c
+++ b/
src/shred.c
@@
-1031,9
+1031,7
@@
wipename (char *oldname, char const *qoldname, struct Options const *flags)
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);
+ int dir_fd = open (dir, O_RDONLY | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
if (flags->verbose)
error (0, 0, _("%s: removing"), qoldname);