diff options
author | Todd C. Miller <Todd.Miller@sudo.ws> | 2022-09-22 11:34:00 -0600 |
---|---|---|
committer | Todd C. Miller <Todd.Miller@sudo.ws> | 2022-09-22 11:34:00 -0600 |
commit | 8a76575532565a7641257799842509c1dbaa5193 (patch) | |
tree | 32d167568be55cd7e80a819922ec89917cdade24 /configure.ac | |
parent | b864d1ef58a5e47e6b60c9a218ffab28de05d2ee (diff) | |
download | sudo-8a76575532565a7641257799842509c1dbaa5193.tar.gz |
Use mkdtempat_np() and mkostempsat_np() on macOS
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 54f2c5e5a..103bc4fad 100644 --- a/configure.ac +++ b/configure.ac @@ -2962,7 +2962,15 @@ AC_CHECK_FUNCS([closefrom], [], [AC_LIBOBJ(closefrom) COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }closefrom_test" ]) sudo_mktemp=no -AC_CHECK_FUNCS([mkdtempat mkostempsat mkstemps mkdtemp], [], [sudo_mktemp=yes; break]) +case "$host_os" in + darwin*) + # macOS has these but uses a _np (non-portable) suffix + AC_CHECK_FUNCS([mkdtempat_np mkostempsat_np], [], [sudo_mktemp=yes; break]) + ;; + *) + AC_CHECK_FUNCS([mkdtempat mkostempsat], [], [sudo_mktemp=yes; break]) + ;; +esac # If any of the mktemp family are missing we use our own. if test X"$sudo_mktemp" = X"yes"; then AC_CHECK_FUNCS([arc4random random lrand48], [break]) |