Skip to content

Commit c52d296

Browse files
authored
chgrp: redundant file check (briandfoy#954)
* In modify_file(), delete a -e file check immediately before stat()ing the file * Allow stat() to fail; it will cover the case where the file argument doesn't exist %perl chgrp root a/b/c/d chgrp: failed to stat 'a/b/c/d': No such file or directory
1 parent dc9d37b commit c52d296

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

bin/chgrp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ sub modify_file {
9898
File::Find::find (\&modify_file, readlink $file);
9999
return;
100100
}
101-
unless (-e $file) {
102-
warn "$Program: '$file' does not exist\n";
103-
$warnings++;
104-
return;
105-
}
106-
107101
my @st = stat $file;
108102
unless (@st) {
109103
warn "$Program: failed to stat '$file': $!\n";

0 commit comments

Comments
 (0)