mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 17:52:43 +00:00
Optimize out no-op chmod() syscalls.
This commit is contained in:
parent
db3c6b6b22
commit
1510e9e7c6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64013
@ -72,6 +72,7 @@ main(argc, argv)
|
||||
int Hflag, Lflag, Pflag, Rflag, ch, fflag, fts_options, hflag, rval;
|
||||
int vflag;
|
||||
char *ep, *mode;
|
||||
int newmode;
|
||||
|
||||
set = NULL;
|
||||
omode = 0;
|
||||
@ -191,8 +192,10 @@ done: argv += optind;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (chmod(p->fts_accpath, oct ? omode :
|
||||
getmode(set, p->fts_statp->st_mode)) && !fflag) {
|
||||
newmode = oct ? omode : getmode(set, p->fts_statp->st_mode);
|
||||
if ((newmode & ALLPERMS) == (p->fts_statp->st_mode & ALLPERMS))
|
||||
continue;
|
||||
if (chmod(p->fts_accpath, newmode) && !fflag) {
|
||||
warn("%s", p->fts_path);
|
||||
rval = 1;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user