Remove a pointless while loop
authorVolker Lendecke <vl@samba.org>
Fri, 25 Jan 2008 08:21:44 +0000 (09:21 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 25 Jan 2008 19:55:51 +0000 (20:55 +0100)
(This used to be commit f591bd68eafdbaefcaa95510cc4cb9a74cef0562)

source3/lib/util_sock.c

index 1a7cc0222901c077028a6dac40019a43054bad70..ce1569d021f9248a372dd2d71ffc9bc68a3f74ec 100644 (file)
@@ -1123,20 +1123,16 @@ ssize_t read_smb_length_return_keepalive(int fd,
 {
        ssize_t len=0;
        int msg_type;
-       bool ok = false;
 
-       while (!ok) {
-               ok = (read_socket_with_timeout(fd,inbuf,4,4,timeout,pre) == 4);
-               if (!ok) {
-                       return -1;
-               }
+       if (read_socket_with_timeout(fd, inbuf, 4, 4, timeout, pre) != 4) {
+               return -1;
+       }
 
-               len = smb_len(inbuf);
-               msg_type = CVAL(inbuf,0);
+       len = smb_len(inbuf);
+       msg_type = CVAL(inbuf,0);
 
-               if (msg_type == SMBkeepalive) {
-                       DEBUG(5,("Got keepalive packet\n"));
-               }
+       if (msg_type == SMBkeepalive) {
+               DEBUG(5,("Got keepalive packet\n"));
        }
 
        DEBUG(10,("got smb length of %lu\n",(unsigned long)len));