Tcl Source Code

Artifact [f6291dfdb5]
Login

Artifact f6291dfdb5f225fbe8905146e45769f28c4ea069:

Attachment "0002-Reduce-scope-of-sys-filio.h-and-sys-ioctl.h.patch" to ticket [1903339fff] added by jenglish 2008-02-28 02:52:35.
From dc5f098cce1a5eb4b0596e02b109c5c271076901 Mon Sep 17 00:00:00 2001
From: Joe English <[email protected]>
Date: Wed, 27 Feb 2008 11:37:24 -0800
Subject: [PATCH] Reduce scope of sys/filio.h and sys/ioctl.h

Moved #includes from tclUnixPort.h to tclUnixCompat.c.

diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c
index 48c813a..c7c8dd2 100644
--- a/unix/tclUnixCompat.c
+++ b/unix/tclUnixCompat.c
@@ -16,6 +16,17 @@
 #include <errno.h>
 #include <string.h>
 
+/* See also: SC_BLOCKING_STYLE in unix/tcl.m4
+ */
+#ifdef	USE_FIONBIO
+#   ifdef HAVE_SYS_FILIO_H
+#	include	<sys/filio.h>	/* For FIONBIO. */
+#   endif
+#   ifdef HAVE_SYS_IOCTL_H
+#	include	<sys/ioctl.h>
+#   endif
+#endif	/* USE_FIONBIO */
+
 /*
  *---------------------------------------------------------------------------
  *
diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h
index dbd2e28..2d12d2b 100644
--- a/unix/tclUnixPort.h
+++ b/unix/tclUnixPort.h
@@ -108,20 +108,6 @@ typedef off_t		Tcl_SeekOffset;
 #else
 #   include "../compat/unistd.h"
 #endif
-#ifdef	USE_FIONBIO
-    /*
-     * Not using the Posix fcntl(...,O_NONBLOCK,...) interface, instead
-     * we are using ioctl(..,FIONBIO,..).
-     */
-
-#   ifdef HAVE_SYS_FILIO_H
-#	include	<sys/filio.h>	/* For FIONBIO. */
-#   endif
-
-#   ifdef HAVE_SYS_IOCTL_H
-#	include	<sys/ioctl.h>	/* For FIONBIO. */
-#   endif
-#endif	/* USE_FIONBIO */
 
 MODULE_SCOPE int TclUnixSetBlockingMode(int fd, int mode);
 
-- 
1.5.0.2