diff options
author | 2015-04-24 16:30:06 +0000 | |
---|---|---|
committer | 2015-04-24 16:30:06 +0000 | |
commit | e7391a6fc6f6fdd26bef9aac20352a181ed189bc (patch) | |
tree | 4a6e51cf456661e5cea78275f95f1f6eaa90352f | |
parent | If ~/.magic exists but can't be used, fail rather than silently falling (diff) | |
download | wireguard-openbsd-e7391a6fc6f6fdd26bef9aac20352a181ed189bc.tar.xz wireguard-openbsd-e7391a6fc6f6fdd26bef9aac20352a181ed189bc.zip |
Use symbolic constants for st_mode flags, no binary change.
-rw-r--r-- | usr.bin/file/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/file/file.c b/usr.bin/file/file.c index 8165f6188b4..a115c4caaa9 100644 --- a/usr.bin/file/file.c +++ b/usr.bin/file/file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.28 2015/04/24 16:28:00 nicm Exp $ */ +/* $OpenBSD: file.c,v 1.29 2015/04/24 16:30:06 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org> @@ -405,9 +405,9 @@ try_access(struct input_file *inf) if (inf->fd != -1) return (0); - if (inf->sb.st_mode & 0222) + if (inf->sb.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)) strlcat(tmp, "writable, ", sizeof tmp); - if (inf->sb.st_mode & 0111) + if (inf->sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) strlcat(tmp, "executable, ", sizeof tmp); if (S_ISREG(inf->sb.st_mode)) strlcat(tmp, "regular file, ", sizeof tmp); |