commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1156023 - in /commons/sandbox/runtime/trunk/src/main/native/os/unix: inetsock.c localsock.c
Date Wed, 10 Aug 2011 04:42:32 GMT
Author: mturk
Date: Wed Aug 10 04:42:32 2011
New Revision: 1156023

URL: http://svn.apache.org/viewvc?rev=1156023&view=rev
Log:
Use struct timeval instead int

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/inetsock.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/inetsock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/inetsock.c?rev=1156023&r1=1156022&r2=1156023&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/inetsock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/inetsock.c Wed Aug 10 04:42:32 2011
@@ -239,11 +239,11 @@ ACR_NET_EXPORT(jint, SocketDescriptor, b
     if (on == JNI_TRUE) {
         if (ACR_HASFLAG(fd, ACR_SO_NONBLOCK) && (rc = AcrNonblock(fd->s, 0)) ==
0) {
 #if HAVE_SO_RCVTIMEO && HAVE_SO_SNDTIMEO
-            int zero = 0;
+            struct timeval zero = { 0, 0 };
             setsockopt(fd->s, SOL_SOCKET, SO_RCVTIMEO,
-                        (char *)&zero, (socklen_t)sizeof(zero));
+                        (char *)&zero, SSIZEOF(struct timeval));
             setsockopt(fd->s, SOL_SOCKET, SO_SNDTIMEO,
-                        (char *)&zero, (socklen_t)sizeof(zero));
+                        (char *)&zero, SSIZEOF(struct timeval));
 #endif
             fd->timeout = -1;
             ACR_CLRFLAG(fd, ACR_SO_NONBLOCK);
@@ -383,11 +383,11 @@ ACR_NET_EXPORT(jlong, SocketServerEndpoi
         }
 #if HAVE_SO_RCVTIMEO && HAVE_SO_SNDTIMEO
         else {
-            int zero = 0;
+            struct timeval zero = { 0, 0 };
             setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO,
-                      (char *)&zero, SSIZEOF(int));
+                      (char *)&zero, SSIZEOF(struct timeval));
             setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO,
-                      (char *)&zero, SSIZEOF(int));
+                      (char *)&zero, SSIZEOF(struct timeval));
         }
 #endif
     }

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c?rev=1156023&r1=1156022&r2=1156023&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/localsock.c Wed Aug 10 04:42:32
2011
@@ -188,11 +188,11 @@ ACR_NET_EXPORT(jlong, LocalServerEndpoin
         }
 #if HAVE_SO_RCVTIMEO && HAVE_SO_SNDTIMEO
         else {
-            int zero = 0;
+            struct timeval zero = { 0, 0 };
             setsockopt(sd, SOL_SOCKET, SO_RCVTIMEO,
-                      (char *)&zero, SSIZEOF(int));
+                      (char *)&zero, SSIZEOF(struct timeval));
             setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO,
-                      (char *)&zero, SSIZEOF(int));
+                      (char *)&zero, SSIZEOF(struct timeval));
         }
 #endif
     }



Mime
View raw message