mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
Use S_IXUSR instead of hardcoded values.
Reviewed by: md5
This commit is contained in:
parent
14070f45a1
commit
db72da7b83
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77608
@ -80,23 +80,23 @@ main(argc, argv)
|
||||
err(2, "stat");
|
||||
|
||||
if (*argv == NULL) {
|
||||
(void)printf("is %s\n", sb.st_mode&0100 ? "y" : "n");
|
||||
return(sb.st_mode & 0100 ? 0 : 1);
|
||||
(void)printf("is %s\n", sb.st_mode & S_IXUSR ? "y" : "n");
|
||||
return(sb.st_mode & S_IXUSR ? 0 : 1);
|
||||
}
|
||||
|
||||
switch(argv[0][0]) {
|
||||
case 'n':
|
||||
if (chmod(name, sb.st_mode & ~0100) < 0)
|
||||
if (chmod(name, sb.st_mode & ~S_IXUSR) < 0)
|
||||
err(2, "%s", name);
|
||||
break;
|
||||
case 'y':
|
||||
if (chmod(name, sb.st_mode | 0100) < 0)
|
||||
if (chmod(name, sb.st_mode | S_IXUSR) < 0)
|
||||
err(2, "%s", name);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
return(sb.st_mode & 0100 ? 0 : 1);
|
||||
return(sb.st_mode & S_IXUSR ? 0 : 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user