summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-25 09:21:44 +0100
committerVolker Lendecke <vl@samba.org>2008-01-25 20:55:51 +0100
commit31a6f807842259ded10dff549f2f57d77ee79c6e (patch)
tree15ed4e9b7d2809cf395a3cecea33f94cc7f52b77
parent0b10c67c0c2b2bf3ea1f55eff092739e435433c1 (diff)
downloadsamba-31a6f807842259ded10dff549f2f57d77ee79c6e.tar.gz
samba-31a6f807842259ded10dff549f2f57d77ee79c6e.tar.bz2
samba-31a6f807842259ded10dff549f2f57d77ee79c6e.zip
Remove a pointless while loop
(This used to be commit f591bd68eafdbaefcaa95510cc4cb9a74cef0562)
-rw-r--r--source3/lib/util_sock.c18
1 files changed, 7 insertions, 11 deletions
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));