declare it ourselves if it is missing.
--HG--
branch : 1.7
/* 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
done
+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_MSG_RESULT($sudo_cv___progname)
])
+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
/* XXX - conflicts with the one in visudo */
int run_command __P((const char *path, char *argv[], char *envp[], uid_t uid, int dowait));
#endif
-#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; \