diff options
author | Jim Meyering <jim@meyering.net> | 2001-01-22 10:51:54 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-01-22 10:51:54 +0000 |
commit | e673a685aca492fc14e5c5e1354848620a660325 (patch) | |
tree | 58a35fe81f66a66f4d36c0a4b762f150e9ba4e9d | |
parent | 37e38b494199d390ffa922f9160435fc51c5fe8b (diff) | |
download | coreutils-e673a685aca492fc14e5c5e1354848620a660325.tar.xz |
(remove_file): Correct an expression to avoid making
an unnecessary call to euidaccess for each file.
-rw-r--r-- | src/remove.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/remove.c b/src/remove.c index 4b1ab3033..2e31323ab 100644 --- a/src/remove.c +++ b/src/remove.c @@ -1,5 +1,5 @@ /* remove.c -- core functions for removing files and directories - Copyright (C) 88, 90, 91, 1994-2000 Free Software Foundation, Inc. + Copyright (C) 88, 90, 91, 1994-2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -615,7 +615,7 @@ remove_file (struct File_spec *fs, const struct rm_options *x) int asked = 0; char *pathname = fs->filename; - if (!x->ignore_missing_files && (x->interactive || x->stdin_tty) + if (!x->ignore_missing_files && x->interactive && x->stdin_tty && euidaccess (pathname, W_OK)) { if (!S_ISLNK (fspec_filetype_mode (fs))) |