Must not call check_timeout() before checking the errno value.
authorWayne Davison <wayned@samba.org>
Sat, 19 Jun 2004 07:09:57 +0000 (07:09 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 19 Jun 2004 07:09:57 +0000 (07:09 +0000)
io.c

diff --git a/io.c b/io.c
index 13f4d3d1a4f1752e67662dbcbf7a8de399481243..ef4735c471a9ae143eb0744379be3cb74d237bfd 100644 (file)
--- a/io.c
+++ b/io.c
@@ -419,9 +419,9 @@ static int read_timeout(int fd, char *buf, size_t len)
                               NULL, &tv);
 
                if (count <= 0) {
-                       check_timeout();
                        if (errno == EBADF)
                                exit_cleanup(RERR_SOCKETIO);
+                       check_timeout();
                        continue;
                }
 
@@ -827,9 +827,9 @@ static void writefd_unbuffered(int fd,char *buf,size_t len)
                               &w_fds, NULL, &tv);
 
                if (count <= 0) {
-                       check_timeout();
                        if (count < 0 && errno == EBADF)
                                exit_cleanup(RERR_SOCKETIO);
+                       check_timeout();
                        continue;
                }