Fixed 'unused variable' compiler warning in prsocket.c. This is pointed
authorwtc
Thu, 09 Apr 1998 19:41:13 +0000
changeset 18 960649e06224cf450fa951aa23bcf089849b740a
parent 10 2b494e85a2cf38eca080348c551182bda54fe181
child 19 d4501178c5335112a14bd0a146782e733b077c25
push idunknown
push userunknown
push dateunknown
Fixed 'unused variable' compiler warning in prsocket.c. This is pointed out by many people, including Nat <gnat@frii.com>.
pr/src/io/prsocket.c
--- a/pr/src/io/prsocket.c
+++ b/pr/src/io/prsocket.c
@@ -160,17 +160,17 @@ static PRStatus PR_CALLBACK SocketConnec
 	else
 		return PR_FAILURE;
 }
 
 PR_IMPLEMENT(PRStatus) PR_GetConnectStatus(const PRPollDesc *pd)
 {
     PRInt32 osfd;
     PRFileDesc *bottom = pd->fd;
-    int err, len;
+    int err;
 
     if (pd->out_flags & PR_POLL_NVAL) {
         PR_SetError(PR_BAD_DESCRIPTOR_ERROR, 0);
         return PR_FAILURE;
     }
     if ((pd->out_flags & (PR_POLL_WRITE | PR_POLL_EXCEPT | PR_POLL_ERR)) == 0) {
         PR_ASSERT(pd->out_flags == 0);
         PR_SetError(PR_IN_PROGRESS_ERROR, 0);
@@ -189,23 +189,23 @@ PR_IMPLEMENT(PRStatus) PR_GetConnectStat
         _PR_MD_MAP_CONNECT_ERROR(err);
         return PR_FAILURE;
     }
     return PR_SUCCESS;
 
 #elif defined(WIN32) || defined(WIN16)
 
     if (pd->out_flags & PR_POLL_EXCEPT) {
+        int len = sizeof(err);
 #if defined(WIN32)
 /* Note: There is a bug in Win32 WinSock. The sleep circumvents the
 ** bug. See wtc. /s lth.
 */
         Sleep(0);
 #endif /* WIN32 */
-        len = sizeof(err);
         if (getsockopt(osfd, (int)SOL_SOCKET, SO_ERROR, (char *) &err, &len)
                 == SOCKET_ERROR) {
             _PR_MD_MAP_GETSOCKOPT_ERROR(WSAGetLastError());
             return PR_FAILURE;
         }
         if (err != 0) {
             _PR_MD_MAP_CONNECT_ERROR(err);
         } else {
@@ -215,17 +215,17 @@ PR_IMPLEMENT(PRStatus) PR_GetConnectStat
     }
 
     PR_ASSERT(pd->out_flags & PR_POLL_WRITE);
     return PR_SUCCESS;
 
 #elif defined(XP_OS2)
 
     if (pd->out_flags & PR_POLL_EXCEPT) {
-        len = sizeof(err);
+        int len = sizeof(err);
         if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &len)
                 < 0) {
             _PR_MD_MAP_GETSOCKOPT_ERROR(sock_errno());
             return PR_FAILURE;
         }
         if (err != 0) {
             _PR_MD_MAP_CONNECT_ERROR(err);
         } else {