configure: Use errno.h instead of the non-standard sys/errno.h header.

Francois Gouget fgouget at free.fr
Thu Dec 15 04:16:27 CST 2011


---

>From what I've heard sys/errno.h was only needed on some old buggy Linux 
distributions. But nowadays including it only seems to serve as a bad 
coding practice example. As far as I can tell, sys/errno.h is not even 
needed on Debian 4.0. I also tested compiling on Debian Testing, FreeBSD 
8.1, Solaris 11.11 and Leopard.


 configure                         |    1 -
 configure.ac                      |    1 -
 dlls/avicap32/avicap32_main.c     |    4 +---
 dlls/dinput/joystick_linux.c      |    3 ---
 dlls/dinput/joystick_linuxinput.c |    3 ---
 dlls/ntdll/file.c                 |    3 ---
 dlls/ntdll/virtual.c              |    3 ---
 dlls/qcap/v4l.c                   |    4 +---
 dlls/winejoystick.drv/joystick.c  |    4 +---
 dlls/wineoss.drv/midi.c           |    3 ---
 dlls/wineoss.drv/mmaux.c          |    3 ---
 dlls/ws2_32/socket.c              |    3 ---
 include/config.h.in               |    3 ---
 server/change.c                   |    3 ---
 server/file.c                     |    3 ---
 server/sock.c                     |    3 ---
 16 files changed, 3 insertions(+), 44 deletions(-)

diff --git a/configure b/configure
index dd54f3d..98080e2 100755
--- a/configure
+++ b/configure
@@ -5815,7 +5815,6 @@ for ac_header in \
 	sys/cdio.h \
 	sys/elf32.h \
 	sys/epoll.h \
-	sys/errno.h \
 	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
diff --git a/configure.ac b/configure.ac
index d96e78f..99704c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -460,7 +460,6 @@ AC_CHECK_HEADERS(\
 	sys/cdio.h \
 	sys/elf32.h \
 	sys/epoll.h \
-	sys/errno.h \
 	sys/event.h \
 	sys/exec_elf.h \
 	sys/filio.h \
diff --git a/dlls/avicap32/avicap32_main.c b/dlls/avicap32/avicap32_main.c
index 3d0b661..7ee7b63 100644
--- a/dlls/avicap32/avicap32_main.c
+++ b/dlls/avicap32/avicap32_main.c
@@ -29,9 +29,7 @@
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-# include <sys/errno.h>
-#endif
+#include <errno.h>
 #ifdef HAVE_SYS_TIME_H
 # include <sys/time.h>
 #endif
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 3ad592d..d951e76 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -43,9 +43,6 @@
 # include <sys/ioctl.h>
 #endif
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-# include <sys/errno.h>
-#endif
 #ifdef HAVE_LINUX_IOCTL_H
 # include <linux/ioctl.h>
 #endif
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index a88391c..2902f9f 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -39,9 +39,6 @@
 # include <sys/ioctl.h>
 #endif
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-# include <sys/errno.h>
-#endif
 #ifdef HAVE_LINUX_INPUT_H
 # include <linux/input.h>
 # undef SW_MAX
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
index 744e09f..3bdf447 100644
--- a/dlls/ntdll/file.c
+++ b/dlls/ntdll/file.c
@@ -27,9 +27,6 @@
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #ifdef HAVE_LINUX_MAJOR_H
 # include <linux/major.h>
 #endif
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 9853628..e6ca21a 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -23,9 +23,6 @@
 
 #include <assert.h>
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #include <fcntl.h>
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
diff --git a/dlls/qcap/v4l.c b/dlls/qcap/v4l.c
index a7995e2..119eb29 100644
--- a/dlls/qcap/v4l.c
+++ b/dlls/qcap/v4l.c
@@ -38,9 +38,7 @@
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
+#include <errno.h>
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif
diff --git a/dlls/winejoystick.drv/joystick.c b/dlls/winejoystick.drv/joystick.c
index df73b4c..577e593 100644
--- a/dlls/winejoystick.drv/joystick.c
+++ b/dlls/winejoystick.drv/joystick.c
@@ -60,9 +60,7 @@
 #define JOYDEV_NEW "/dev/input/js%d"
 #define JOYDEV_OLD "/dev/js%d"
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
+#include <errno.h>
 
 #include "windef.h"
 #include "winbase.h"
diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c
index 72ceb1a..b1c60da 100644
--- a/dlls/wineoss.drv/midi.c
+++ b/dlls/wineoss.drv/midi.c
@@ -60,9 +60,6 @@
 #ifdef HAVE_SYS_POLL_H
 #include <sys/poll.h>
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #include <sys/soundcard.h>
 
 #include "windef.h"
diff --git a/dlls/wineoss.drv/mmaux.c b/dlls/wineoss.drv/mmaux.c
index 3dbc6a0..216d2e2 100644
--- a/dlls/wineoss.drv/mmaux.c
+++ b/dlls/wineoss.drv/mmaux.c
@@ -31,9 +31,6 @@
 #ifdef HAVE_SYS_IOCTL_H
 # include <sys/ioctl.h>
 #endif
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #include <sys/soundcard.h>
 
 #include "windef.h"
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 0d44e68..8743317 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -76,9 +76,6 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #ifdef HAVE_NETDB_H
 #include <netdb.h>
 #endif
diff --git a/include/config.h.in b/include/config.h.in
index 60179db..34c6db4 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -884,9 +884,6 @@
 /* Define to 1 if you have the <sys/epoll.h> header file. */
 #undef HAVE_SYS_EPOLL_H
 
-/* Define to 1 if you have the <sys/errno.h> header file. */
-#undef HAVE_SYS_ERRNO_H
-
 /* Define to 1 if you have the <sys/event.h> header file. */
 #undef HAVE_SYS_EVENT_H
 
diff --git a/server/change.c b/server/change.c
index 6461e95..f6d56b0 100644
--- a/server/change.c
+++ b/server/change.c
@@ -32,9 +32,6 @@
 #include <limits.h>
 #include <dirent.h>
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 
 #include "ntstatus.h"
 #define WIN32_NO_STATUS
diff --git a/server/file.c b/server/file.c
index 07dab39..02a1e37 100644
--- a/server/file.c
+++ b/server/file.c
@@ -28,9 +28,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-#include <sys/errno.h>
-#endif
 #include <sys/stat.h>
 #include <sys/time.h>
 #include <sys/types.h>
diff --git a/server/sock.c b/server/sock.c
index 9f62da2..7e4acd8 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -30,9 +30,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
-#ifdef HAVE_SYS_ERRNO_H
-# include <sys/errno.h>
-#endif
 #include <sys/time.h>
 #include <sys/types.h>
 #ifdef HAVE_SYS_SOCKET_H
-- 
1.7.7.3



More information about the wine-patches mailing list