declare it ourselves if it is missing.
#endif
#include <errno.h>
-#define MAX_RESULTS 256
+#include "missing.h"
-#ifndef errno
-extern int errno;
-#endif
+#define MAX_RESULTS 256
struct gl_entry {
int flags;
/* Define to 1 if your `DIR' contains dd_fd. */
#undef HAVE_DD_FD
+/* Define to 1 if you have the declaration of `errno', and to 0 if you don't.
+ */
+#undef HAVE_DECL_ERRNO
+
/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
don't. */
#undef HAVE_DECL_SYS_SIGLIST
fi
+ac_fn_c_check_decl "$LINENO" "errno" "ac_cv_have_decl_errno" "
+$ac_includes_default
+#include <errno.h>
+
+"
+if test "x$ac_cv_have_decl_errno" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ERRNO $ac_have_decl
+_ACEOF
+
+
for ac_func in strsignal
do :
ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal"
AC_CONFIG_FILES([zlib/Makefile])
fi
+dnl
+dnl Check for errno declaration in errno.h
+dnl
+AC_CHECK_DECLS([errno], [], [], [
+AC_INCLUDES_DEFAULT
+#include <errno.h>
+])
+
dnl
dnl Check for strsignal() or sys_siglist
dnl
#endif /* HAVE___PROGNAME */
#endif /* !HAVE_GETPROGNAME */
+/*
+ * Declare errno if errno.h doesn't do it for us.
+ */
+#if defined(HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif /* !HAVE_DECL_ERRNO */
+
#ifndef timevalclear
# define timevalclear(tv) ((tv)->tv_sec = (tv)->tv_usec = 0)
#endif
extern sudo_printf_t sudo_printf;
#endif
-/* Some systems don't declare errno in errno.h */
-#ifndef errno
-extern int errno;
-#endif
-
#endif /* _SUDO_SUDOERS_H */
/* setgroups.c */
int sudo_setgroups(int ngids, const GETGROUPS_T *gids);
-#ifndef errno
-extern int errno;
-#endif
-
#endif /* _SUDO_SUDO_H */
* few programs actually do that.
*/
-#ifndef errno
-extern int errno;
-#endif
-
#define DUMMY_BODY \
{ \
errno = EACCES; \