Hi,

Now that we have pselect(), remove this patch that replaces pselect
with select+sigprocmask.

I've finally tested it with a proper system (eheheh :)) and it works
w/o problems.

Ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/mosh/Makefile,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 Makefile
--- Makefile    21 Apr 2013 19:46:37 -0000      1.1.1.1
+++ Makefile    30 Apr 2013 17:43:49 -0000
@@ -4,6 +4,8 @@ COMMENT =               mobile shell
 
 DISTNAME =             mosh-1.2.4
 
+REVISION =             0
+
 CATEGORIES =           net
 
 HOMEPAGE =             http://mosh.mit.edu/
Index: patches/patch-src_util_select_h
===================================================================
RCS file: patches/patch-src_util_select_h
diff -N patches/patch-src_util_select_h
--- patches/patch-src_util_select_h     21 Apr 2013 19:46:37 -0000      1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-$OpenBSD: patch-src_util_select_h,v 1.1.1.1 2013/04/21 19:46:37 sthen Exp $
-
-Use select and sigprocmask instead of pselect.
-Reported upstream...
-
---- src/util/select.h.orig     Fri Oct 19 21:45:18 2012
-+++ src/util/select.h  Mon Mar 11 01:39:22 2013
-@@ -118,6 +118,7 @@ class Select { (public)
-     fatal_assert( 0 == sigaction( signum, &sa, NULL ) );
-   }
- 
-+  /* timeout unit: milliseconds; negative timeout means wait forever */
-   int select( int timeout )
-   {
-     memcpy( &read_fds,  &all_fds, sizeof( read_fds  ) );
-@@ -125,18 +126,34 @@ class Select { (public)
-     clear_got_signal();
-     got_any_signal = 0;
- 
-+#ifdef HAVE_PSELECT
-     struct timespec ts;
-     struct timespec *tsp = NULL;
- 
-     if ( timeout >= 0 ) {
--      // timeout in milliseconds
-       ts.tv_sec  = timeout / 1000;
-       ts.tv_nsec = 1000000 * (long( timeout ) % 1000);
-       tsp = &ts;
-     }
--    // negative timeout means wait forever
- 
-     int ret = ::pselect( max_fd + 1, &read_fds, NULL, &error_fds, tsp, 
&empty_sigset );
-+#else
-+    struct timeval tv;
-+    struct timeval *tvp = NULL;
-+    sigset_t old_sigset;
-+
-+    if ( timeout >= 0 ) {
-+      tv.tv_sec  = timeout / 1000;
-+      tv.tv_usec = 1000 * (long( timeout ) % 1000);
-+      tvp = &tv;
-+    }
-+
-+    int ret = ::sigprocmask( SIG_SETMASK, &empty_sigset, &old_sigset );
-+    if ( ret != -1 ) {
-+      ret = ::select( max_fd + 1, &read_fds, NULL, &error_fds, tvp );
-+      ::sigprocmask( SIG_SETMASK, &old_sigset, NULL );
-+    }
-+#endif
- 
-     if ( ( ret == -1 ) && ( errno == EINTR ) ) {
-       /* The user should process events as usual. */

Reply via email to