diff --git a/configure.ac b/configure.ac index b1734abc7b..fb231ed287 100644 --- a/configure.ac +++ b/configure.ac @@ -379,7 +379,6 @@ AC_HEADER_TIME AC_CHECK_HEADERS([ \ execinfo.h \ -errno.h \ libgen.h \ mcheck.h \ netinet/in.h \ diff --git a/src/lib/ecore_con/ecore_con_dns.c b/src/lib/ecore_con/ecore_con_dns.c index 7851d0db82..8180cbec77 100644 --- a/src/lib/ecore_con/ecore_con_dns.c +++ b/src/lib/ecore_con/ecore_con_dns.c @@ -11,10 +11,7 @@ #include #include - -#ifdef HAVE_ERRNO_H -# include /* for EAGAIN */ -#endif +#include /* for EAGAIN */ #ifdef HAVE_NETINET_IN_H # include @@ -24,10 +21,6 @@ # include #endif -#ifdef HAVE_ERRNO_H -# include -#endif - #include "dns.h" #include "Ecore.h" diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c index 647d9d502d..6a67ef89d7 100644 --- a/src/lib/ecore_con/ecore_con_local.c +++ b/src/lib/ecore_con/ecore_con_local.c @@ -2,6 +2,7 @@ # include #endif +#include #include #include #include @@ -10,10 +11,6 @@ #include #include -#ifdef HAVE_ERRNO_H -# include -#endif - #ifdef HAVE_SYS_SOCKET_H # include #endif diff --git a/src/lib/escape/escape_unistd.c b/src/lib/escape/escape_unistd.c index 5dbbb18634..3ac3ee7bf0 100644 --- a/src/lib/escape/escape_unistd.c +++ b/src/lib/escape/escape_unistd.c @@ -2,9 +2,7 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ -#ifdef HAVE_ERRNO_H #include -#endif /* HAVE_ERRNO_H */ #include /* See NOTES */ #include diff --git a/src/lib/evil/evil_dirent.c b/src/lib/evil/evil_dirent.c index e02b95fe27..041899d53e 100644 --- a/src/lib/evil/evil_dirent.c +++ b/src/lib/evil/evil_dirent.c @@ -3,10 +3,7 @@ #endif /* HAVE_CONFIG_H */ #include - -#ifdef HAVE_ERRNO_H -# include -#endif +#include #include "Evil.h" @@ -34,9 +31,7 @@ DIR *opendir(char const *name) /* valid name */ if (!name || !*name) { -#ifdef HAVE_ERRNO_H errno = ENOENT; -#endif return NULL; } @@ -44,9 +39,7 @@ DIR *opendir(char const *name) wname = evil_char_to_wchar(name); if (!wname) { -# ifdef HAVE_ERRNO_H errno = ENOMEM; -# endif return NULL; } @@ -55,9 +48,7 @@ DIR *opendir(char const *name) if((attr = GetFileAttributes(name)) == 0xFFFFFFFF) #endif { -#ifdef HAVE_ERRNO_H errno = ENOENT; -#endif return NULL; } @@ -68,18 +59,14 @@ DIR *opendir(char const *name) /* directory */ if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) { -#ifdef HAVE_ERRNO_H errno = ENOTDIR; -#endif return NULL; } dir = (DIR *)malloc(sizeof(DIR)); if (!dir) { -#ifdef HAVE_ERRNO_H errno = ENOMEM; -#endif return NULL; } @@ -87,9 +74,7 @@ DIR *opendir(char const *name) tmp1 = (char *)malloc(sizeof(char) * l + 5); if (!tmp1) { -#ifdef HAVE_ERRNO_H errno = ENOMEM; -#endif return NULL; } @@ -107,9 +92,7 @@ DIR *opendir(char const *name) wname = evil_char_to_wchar(tmp1); if (!wname) { -#ifdef HAVE_ERRNO_H errno = ENOMEM; -#endif free(tmp1); return NULL; @@ -149,9 +132,7 @@ int closedir(DIR *dir) { if (!dir) { -#ifdef HAVE_ERRNO_H errno = EBADF; -#endif return -1; } @@ -170,9 +151,7 @@ struct dirent *readdir(DIR *dir) if (!dir) { -#ifdef HAVE_ERRNO_H errno = EBADF; -#endif return NULL; } diff --git a/src/lib/evil/evil_inet.c b/src/lib/evil/evil_inet.c index 99ce14edc2..c4938334af 100644 --- a/src/lib/evil/evil_inet.c +++ b/src/lib/evil/evil_inet.c @@ -26,13 +26,10 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ +#include #include #include -#ifdef HAVE_ERRNO_H -# include -#endif /* HAVE_ERRNO_H */ - #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif diff --git a/src/lib/evil/evil_link_xp.cpp b/src/lib/evil/evil_link_xp.cpp index 675908f75b..2b5b956b4a 100644 --- a/src/lib/evil/evil_link_xp.cpp +++ b/src/lib/evil/evil_link_xp.cpp @@ -2,9 +2,7 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ -#ifdef HAVE_ERRNO_H #include -#endif /* HAVE_ERRNO_H */ #include #include diff --git a/src/lib/evil/evil_printa.c b/src/lib/evil/evil_printa.c index e6f6eb8227..a0f8593916 100644 --- a/src/lib/evil/evil_printa.c +++ b/src/lib/evil/evil_printa.c @@ -1,5 +1,6 @@ #define __CRT__NO_INLINE +#include #include #include #include @@ -12,10 +13,6 @@ #include #include -#ifdef HAVE_ERRNO_H -# include -#endif /* HAVE_ERRNO_H */ - #include "evil_pformat.h" #include "evil_print.h" #include "gdtoa/gdtoa.h" @@ -300,9 +297,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) if (!s || s->fp == NULL || !format) { -#ifdef HAVE_ERRNO_H errno = EINVAL; -#endif /* HAVE_ERRNO_H */ return EOF; } @@ -485,10 +480,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) do { if ((c == EOF || (c = in_ch (s, &read_in)) == EOF) -#ifdef HAVE_ERRNO_H - && errno == EINTR -#endif /* HAVE_ERRNO_H */ - ) + && errno == EINTR) return cleanup_return ((!rval ? EOF : rval), &gcollect, pstr, &wbuf); } while (isspace (c)); @@ -678,9 +670,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) { if ((c = in_ch (s, &read_in)) == EOF) { -#ifdef HAVE_ERRNO_H errno = EILSEQ; -#endif /* HAVE_ERRNO_H */ return cleanup_return (rval, &gcollect, pstr, &wbuf); } @@ -690,9 +680,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) if (n != 1) { -#ifdef HAVE_ERRNO_H errno = EILSEQ; -#endif /* HAVE_ERRNO_H */ return cleanup_return (rval, &gcollect, pstr, &wbuf); } break; @@ -842,9 +830,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) { if ((c = in_ch (s, &read_in)) == EOF) { -#ifdef HAVE_ERRNO_H errno = EILSEQ; -#endif /* HAVE_ERRNO_H */ return cleanup_return (rval, &gcollect, pstr, &wbuf); } @@ -854,9 +840,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) if (n != 1) { -#ifdef HAVE_ERRNO_H errno = EILSEQ; -#endif /* HAVE_ERRNO_H */ return cleanup_return (rval, &gcollect, pstr, &wbuf); } @@ -1485,9 +1469,7 @@ _evil_sformat (_IFP *s, const char *format, va_list argp) if (cnt != 0) { -#ifdef HAVE_ERRNO_H errno = EILSEQ; -#endif /* HAVE_ERRNO_H */ return cleanup_return (rval, &gcollect, pstr, &wbuf); } diff --git a/src/lib/evil/evil_stdlib.c b/src/lib/evil/evil_stdlib.c index d22a7dc71e..ffd9acde9a 100644 --- a/src/lib/evil/evil_stdlib.c +++ b/src/lib/evil/evil_stdlib.c @@ -8,9 +8,7 @@ #include #include -#ifdef HAVE_ERRNO_H -# include -#endif /* HAVE_ERRNO_H */ +#include #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN @@ -147,9 +145,7 @@ setenv(const char *name, /* if '=' is found, return EINVAL */ if (strchr (name, '=')) { -#ifdef HAVE_ERRNO_H errno = EINVAL; -#endif /* HAVE_ERRNO_H */ return -1; } @@ -163,9 +159,7 @@ setenv(const char *name, str = (char *)malloc(length); if (!str) { -#ifdef HAVE_ERRNO_H errno = ENOMEM; -#endif /* HAVE_ERRNO_H */ return -1; } if (!value) @@ -292,9 +286,7 @@ mkstemp(char *__template) if ((length < 6) || (strncmp (__template + length - 6, "XXXXXX", 6))) { -#ifdef HAVE_ERRNO_H errno = EINVAL; -#endif /* HAVE_ERRNO_H */ return -1; } @@ -337,9 +329,7 @@ mkstemp(char *__template) free(wtemplate); if (!f) { -# ifdef HAVE_ERRNO_H errno = EEXIST; -# endif /* HAVE_ERRNO_H */ return -1; } fd = (int)_fileno(f); @@ -351,9 +341,7 @@ mkstemp(char *__template) val += 7777; } -#ifdef HAVE_ERRNO_H errno = EEXIST; -#endif /* HAVE_ERRNO_H */ return -1; } diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c index 10ef018e1e..cfa5320aba 100644 --- a/src/lib/evil/evil_unistd.c +++ b/src/lib/evil/evil_unistd.c @@ -2,9 +2,7 @@ # include "config.h" #endif /* HAVE_CONFIG_H */ -#ifdef HAVE_ERRNO_H #include -#endif /* HAVE_ERRNO_H */ #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN