which: remove unnecessary third parameter in O_RDONLY call to open(3)
Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
parent
9719a7e3d2
commit
be34c4a24d
2
which.c
2
which.c
@ -43,7 +43,7 @@ which(const char *path, const char *name)
|
|||||||
if (ptr[i] != ':' && ptr[i] != '\0')
|
if (ptr[i] != ':' && ptr[i] != '\0')
|
||||||
continue;
|
continue;
|
||||||
ptr[i] = '\0';
|
ptr[i] = '\0';
|
||||||
if ((dirfd = open(p, O_RDONLY, 0)) >= 0) {
|
if ((dirfd = open(p, O_RDONLY)) >= 0) {
|
||||||
if (canexec(dirfd, name)) {
|
if (canexec(dirfd, name)) {
|
||||||
found = 1;
|
found = 1;
|
||||||
fputs(p, stdout);
|
fputs(p, stdout);
|
||||||
|
Loading…
Reference in New Issue
Block a user