From 31a6f807842259ded10dff549f2f57d77ee79c6e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 25 Jan 2008 09:21:44 +0100 Subject: Remove a pointless while loop (This used to be commit f591bd68eafdbaefcaa95510cc4cb9a74cef0562) --- source3/lib/util_sock.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'source3/lib/util_sock.c') diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 1a7cc02229..ce1569d021 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -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)); -- cgit