]> code.delx.au - gnu-emacs/commitdiff
Assume !BROKEN_NON_BLOCKING_CONNECT
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Mar 2015 17:36:15 +0000 (10:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 27 Mar 2015 17:37:14 +0000 (10:37 -0700)
From a suggestion by Eli Zaretskii in:
http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00824.html
* process.c (NON_BLOCKING_CONNECT): Simplify by assuming that
BROKEN_NON_BLOCKING_CONNECT is not defined.
(SELECT_CAN_DO_WRITE_MASK): Remove, and assume it's now true.

admin/CPP-DEFINES
src/ChangeLog
src/process.c

index 18423c23420762c309f50af8008f656560a1af0e..796b57db3d8640c3f5980170ee212f46108c5408 100644 (file)
@@ -85,7 +85,6 @@ AMPERSAND_FULL_NAME
 BROKEN_DATAGRAM_SOCKETS
 BROKEN_FIONREAD
 BROKEN_GET_CURRENT_DIR_NAME
-BROKEN_NON_BLOCKING_CONNECT
 BROKEN_PTY_READ_AFTER_EAGAIN
 DEFAULT_SOUND_DEVICE
 DEVICE_SEP
index 98037e851a4088b332df71daa6d210b15c3ae87e..3f9ab4fff438e680f2f65662008c454f6b5ac4cd 100644 (file)
@@ -1,3 +1,12 @@
+2015-03-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Assume !BROKEN_NON_BLOCKING_CONNECT
+       From a suggestion by Eli Zaretskii in:
+       http://lists.gnu.org/archive/html/emacs-devel/2015-03/msg00824.html
+       * process.c (NON_BLOCKING_CONNECT): Simplify by assuming that
+       BROKEN_NON_BLOCKING_CONNECT is not defined.
+       (SELECT_CAN_DO_WRITE_MASK): Remove, and assume it's now true.
+
 2015-03-27  Eli Zaretskii  <eliz@gnu.org>
 
        * lread.c (substitute_object_recurse): For sub-char-tables, start
index 3fe8644b48aa9aa17d4b742770dbcb6c47312f38..2800fa58340901bf0fb4d10d05d2637ad04a526b 100644 (file)
@@ -195,24 +195,15 @@ static EMACS_INT process_tick;
 /* Number of events for which the user or sentinel has been notified.  */
 static EMACS_INT update_tick;
 
-/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects.  */
+/* Define NON_BLOCKING_CONNECT if we can support non-blocking connects.
+   The code can be simplified by assuming NON_BLOCKING_CONNECT once
+   Emacs starts assuming POSIX 1003.1-2001 or later.  */
 
-/* Only W32 has this, it really means that select can't take write mask.  */
-#ifdef BROKEN_NON_BLOCKING_CONNECT
-#undef NON_BLOCKING_CONNECT
-enum { SELECT_CAN_DO_WRITE_MASK = false };
-#else
-enum { SELECT_CAN_DO_WRITE_MASK = true };
-#ifndef NON_BLOCKING_CONNECT
-#ifdef HAVE_SELECT
-#if defined (HAVE_GETPEERNAME) || defined (GNU_LINUX)
-#if defined (EWOULDBLOCK) || defined (EINPROGRESS)
-#define NON_BLOCKING_CONNECT
-#endif /* EWOULDBLOCK || EINPROGRESS */
-#endif /* HAVE_GETPEERNAME || GNU_LINUX */
-#endif /* HAVE_SELECT */
-#endif /* NON_BLOCKING_CONNECT */
-#endif /* BROKEN_NON_BLOCKING_CONNECT */
+#if (defined HAVE_SELECT                               \
+     && (defined GNU_LINUX || defined HAVE_GETPEERNAME)        \
+     && (defined EWOULDBLOCK || defined EINPROGRESS))
+# define NON_BLOCKING_CONNECT
+#endif
 
 /* Define DATAGRAM_SOCKETS if datagrams can be used safely on
    this system.  We need to read full packets, so we need a
@@ -4606,7 +4597,7 @@ wait_reading_process_output (intmax_t time_limit, int nsecs, int read_kbd,
            Available = input_wait_mask;
           Writeok = write_mask;
          check_delay = wait_proc ? 0 : process_output_delay_count;
-         check_write = SELECT_CAN_DO_WRITE_MASK;
+         check_write = true;
        }
 
       /* If frame size has changed or the window is newly mapped,