commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1147950 - /commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c
Date Mon, 18 Jul 2011 16:22:57 GMT
Author: mturk
Date: Mon Jul 18 16:22:57 2011
New Revision: 1147950

URL: http://svn.apache.org/viewvc?rev=1147950&view=rev
Log:
Axe copy/paste code

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c?rev=1147950&r1=1147949&r2=1147950&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/darwin/kqueue.c Mon Jul 18 16:22:57 2011
@@ -93,7 +93,7 @@ static short iefilter(short event)
         return EVFILT_WRITE;
 }
 
-static short reventt(short event, short flag)
+static short reventt(short event, short flags)
 {
     short rv = 0;
 
@@ -432,59 +432,6 @@ ACR_NET_EXPORT(int, UnixSelector, destro
     return rc;
 }
 
-static int call_port_getn(int port, struct kevent list[],
-                          unsigned int max, unsigned int *nget,
-                          int timeout)
-{
-    struct timespec tv, *tp = 0;
-    int ret;
-    int rv = 0;
-
-    if (timeout >= 0) {
-        tp = &tv;
-        tp->tv_sec  = (long)(timeout / 1000);
-        tp->tv_nsec = (long)(timeout % 1000) * 1000000;
-    }
-
-    list[0].portev_user = (void *)-1; /* so we can double check that an
-                                       * event was returned
-                                       */
-    ret = port_getn(port, list, max, nget, tp);
-    /* Note: 32-bit port_getn() on Solaris 10 x86 returns large negative 
-     * values instead of 0 when returning immediately.
-     */
-    if (ret == -1) {
-        rv = ACR_GET_NETOS_ERROR();
-        switch(rv) {
-            case EINTR:
-            case ETIME:
-                if (*nget > 0 && list[0].portev_user != (void *)-1) {
-                    /* This confusing API can return an event at the same time
-                     * that it reports EINTR or ETIME.  If that occurs, just
-                     * report the event.  With EINTR, nget can be > 0 without
-                     * any event, so check that portev_user was filled in.
-                     *
-                     * (Maybe it will be simplified; see thread
-                     *   http://mail.opensolaris.org
-                     *   /pipermail/networking-discuss/2009-August/011979.html
-                     *  This code will still work afterwards.)
-                     */
-                    rv = 0;
-                    break;
-                }
-                if (rv == ETIME)
-                    rv = ACR_TIMEUP;
-            /* fall-through */
-            default:
-                *nget = 0;
-            break;
-        }
-    }
-    else if (*nget == 0)
-        rv = ACR_TIMEUP;
-    return rv;
-}
-
 ACR_NET_EXPORT(void, UnixSelector, wait0)(JNI_STDARGS, jlong pollset,
                                           jobject sset,
                                           jint timeout, jboolean autocancel)



Mime
View raw message