[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] Fix ccsd infinite loop on EBADF/EPIPE/etc.



This patch makes ccsd quietly retry in EINTR cases (e.g. interrupted
before any data sent), and give up in other, more serious conditions
(e.g. EPIPE).

-- Lon
Index: cnx_mgr.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/cnx_mgr.c,v
retrieving revision 1.24.2.12
diff -u -r1.24.2.12 cnx_mgr.c
--- cnx_mgr.c	12 Jan 2006 18:11:26 -0000	1.24.2.12
+++ cnx_mgr.c	14 Jun 2006 16:04:50 -0000
@@ -1233,8 +1233,9 @@
  fail:
   error = write(afd, ch, sizeof(comm_header_t)+ch->comm_payload_size);
   if(error < 0){
+    if (errno == EINTR)
+      goto fail;
     log_sys_err("Unable to write package back to sender");
-    goto fail;
   } else if(error < (sizeof(comm_header_t)+ch->comm_payload_size)){
     log_err("Unable to write complete package.\n");
     error = -EBADE;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]