commit be34c4a24d1d07b6b3dbd99168fb3de299c88d9a
Author:     Mattias Andrée <[email protected]>
AuthorDate: Sat Jul 27 22:29:11 2019 +0200
Commit:     Michael Forney <[email protected]>
CommitDate: Mon Jul 29 18:49:14 2019 -0700

    which: remove unnecessary third parameter in O_RDONLY call to open(3)
    
    Signed-off-by: Mattias Andrée <[email protected]>

diff --git a/which.c b/which.c
index cc93361..3f9af6e 100644
--- a/which.c
+++ b/which.c
@@ -43,7 +43,7 @@ which(const char *path, const char *name)
                if (ptr[i] != ':' && ptr[i] != '\0')
                        continue;
                ptr[i] = '\0';
-               if ((dirfd = open(p, O_RDONLY, 0)) >= 0) {
+               if ((dirfd = open(p, O_RDONLY)) >= 0) {
                        if (canexec(dirfd, name)) {
                                found = 1;
                                fputs(p, stdout);

Reply via email to