Remove horrid goto.
authorJeremy Allison <jra@samba.org>
Wed, 22 May 2002 20:54:26 +0000 (20:54 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 22 May 2002 20:54:26 +0000 (20:54 +0000)
Jeremy.
(This used to be commit 7e6db250804e51ce0883b972831da455d389cdcd)

source3/smbd/oplock.c

index bf0e1cf69afa13807d8b62d3d5f5996edee616b0..e01b1b3e7e1c23bcaeb902cce06e1f7c9dfb4fd4 100644 (file)
@@ -78,18 +78,14 @@ BOOL receive_local_message( char *buffer, int buffer_len, int timeout)
        socklen_t fromlen = sizeof(from);
        int32 msg_len = 0;
        fd_set fds;
+       int selrtn = -1;
 
        smb_read_error = 0;
 
-       if(timeout != 0) {
+       while (timeout > 0) {
                struct timeval to;
-               int selrtn;
                int maxfd = oplock_sock;
-               time_t starttime;
-
-  again:
-
-               starttime = time(NULL);
+               time_t starttime = time(NULL);
 
                FD_ZERO(&fds);
                maxfd = setup_oplock_select_set(&fds);
@@ -110,11 +106,10 @@ BOOL receive_local_message( char *buffer, int buffer_len, int timeout)
                        /* We need to decrement the timeout here. */
                        timeout -= ((time(NULL) - starttime)*1000);
                        if (timeout < 0)
-                               timeout = 0;
+                               timeout = 1;
 
                        DEBUG(5,("receive_local_message: EINTR : new timeout %d ms\n", timeout));
-
-                       goto again;
+                       continue;
                }
 
                /* Check if error */