From fd79e385d775472a2ff5d9e91cca93546b14f75d Mon Sep 17 00:00:00 2001 From: Jesse Smith Date: Sun, 10 Mar 2019 19:22:09 -0300 Subject: [PATCH] Minor fixes to avoid compiling error on FreeBSD following Linux fixes. --- doas.c | 6 +++--- env.c | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doas.c b/doas.c index 5baa8f6..23e1a9e 100644 --- a/doas.c +++ b/doas.c @@ -510,17 +510,17 @@ main(int argc, char **argv) } pam_end(pamh, pam_err); -/* #ifndef linux */ +#ifndef linux /* Re-establish stdin */ if (dup2(temp_stdin, STDIN_FILENO) == -1) err(1, "dup2"); close(temp_stdin); -/* #else */ +#else /* Re-establish stdout */ close(1); if (dup2(temp_stdout, 1) == -1) err(1, "dup2"); -/* #endif */ +#endif #else #error No auth module! #endif diff --git a/env.c b/env.c index e463d37..db3f258 100644 --- a/env.c +++ b/env.c @@ -90,7 +90,9 @@ createenv(struct rule *rule) env->count = 0; if (rule->options & KEEPENV) { - /* extern const char **environ; */ + #ifndef linux + extern const char **environ; + #endif for (i = 0; environ[i] != NULL; i++) { struct envnode *node;