Fix typo introduced on systems with O_PATH or O_EXEC

This commit is contained in:
Todd C. Miller
2020-03-11 15:42:46 -06:00
parent d31689211e
commit 277b297ae0

View File

@@ -137,7 +137,7 @@ open_cmnd(const char *path, const struct command_digest_list *digests, int *fdp)
fd = open(path, O_RDONLY|O_NONBLOCK);
# ifdef O_EXEC
if (fd == -1 && errno == EACCES && TAILQ_EMPTY(digests))
if (fd == -1 && errno == EACCES && TAILQ_EMPTY(digests)) {
/* Try again with O_EXEC if no digest is specified. */
const int saved_errno = errno;
if ((fd = open(path, O_EXEC)) == -1)