From 676241d7b1e7acfd9a7f6b7b087a87f96c0ade70 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 22 May 2002 20:54:26 +0000 Subject: Remove horrid goto. Jeremy. (This used to be commit 7e6db250804e51ce0883b972831da455d389cdcd) --- source3/smbd/oplock.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'source3') 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 */ -- cgit