Minor fixes to avoid compiling error on FreeBSD following Linux fixes.

This commit is contained in:
Jesse Smith 2019-03-10 19:22:09 -03:00
parent c8cb4d999e
commit fd79e385d7
2 changed files with 6 additions and 4 deletions

6
doas.c
View file

@ -510,17 +510,17 @@ main(int argc, char **argv)
} }
pam_end(pamh, pam_err); pam_end(pamh, pam_err);
/* #ifndef linux */ #ifndef linux
/* Re-establish stdin */ /* Re-establish stdin */
if (dup2(temp_stdin, STDIN_FILENO) == -1) if (dup2(temp_stdin, STDIN_FILENO) == -1)
err(1, "dup2"); err(1, "dup2");
close(temp_stdin); close(temp_stdin);
/* #else */ #else
/* Re-establish stdout */ /* Re-establish stdout */
close(1); close(1);
if (dup2(temp_stdout, 1) == -1) if (dup2(temp_stdout, 1) == -1)
err(1, "dup2"); err(1, "dup2");
/* #endif */ #endif
#else #else
#error No auth module! #error No auth module!
#endif #endif

4
env.c
View file

@ -90,7 +90,9 @@ createenv(struct rule *rule)
env->count = 0; env->count = 0;
if (rule->options & KEEPENV) { if (rule->options & KEEPENV) {
/* extern const char **environ; */ #ifndef linux
extern const char **environ;
#endif
for (i = 0; environ[i] != NULL; i++) { for (i = 0; environ[i] != NULL; i++) {
struct envnode *node; struct envnode *node;