svn commit: samba r7025 - in branches/SAMBA_3_0/source: lib tdb

derrell at samba.org derrell at samba.org
Fri May 27 18:59:01 GMT 2005


derrell at samba.org writes:

> I'll implement it as a max of MAX_INTERRUPTS (e.g. #define MAX_INTERRUPTS 10)
> interrupts.  MAX_INTERRUPTS can be manipulated as required.

How's this?

Index: lib/util_sock.c
===================================================================
--- lib/util_sock.c	(revision 7037)
+++ lib/util_sock.c	(working copy)
@@ -377,6 +377,8 @@
 {
 	ssize_t ret;
 	size_t total=0;  
+        int interrupts = 0;
+#define MAX_INTERRUPTS  10
  
 	smb_read_error = 0;
 
@@ -390,6 +392,11 @@
 		}
 
 		if (ret == -1) {
+                        if (errno == EAGAIN &&
+                            interrupts++ <= MAX_INTERRUPTS) {
+                                /* interrupted system call.  retry. */
+                                continue;
+                        }
 			DEBUG(0,("read_socket_data: recv failure for %d. Error = %s\n", (int)(N - total), strerror(errno) ));
 			smb_read_error = READ_ERROR;
 			return -1;


More information about the samba-technical mailing list