diff options
author | Jeremy Allison <jra@samba.org> | 2002-05-22 20:54:26 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-05-22 20:54:26 +0000 |
commit | 676241d7b1e7acfd9a7f6b7b087a87f96c0ade70 (patch) | |
tree | d23dbcce6edadd6bc78305adce3c078d4fa3f74b /source3/smbd | |
parent | 2e136b4438379c0dea33898c24bf2fbf670b8770 (diff) | |
download | samba-676241d7b1e7acfd9a7f6b7b087a87f96c0ade70.tar.gz samba-676241d7b1e7acfd9a7f6b7b087a87f96c0ade70.tar.bz2 samba-676241d7b1e7acfd9a7f6b7b087a87f96c0ade70.zip |
Remove horrid goto.
Jeremy.
(This used to be commit 7e6db250804e51ce0883b972831da455d389cdcd)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/oplock.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index bf0e1cf69a..e01b1b3e7e 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -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 */ |