Minimal fix for bug #14766 (common code merger would be better but very
authorZdeněk Salvet <salvet@ics.muni.cz>
Wed, 1 Feb 2006 10:08:58 +0000 (10:08 +0000)
committerZdeněk Salvet <salvet@ics.muni.cz>
Wed, 1 Feb 2006 10:08:58 +0000 (10:08 +0000)
large change). Patchlevel incremented.

org.glite.lb.common/project/version.properties
org.glite.lb.common/src/lb_plain_io.c

index df681cf..a6d696b 100644 (file)
@@ -1,4 +1,4 @@
 #Fri Sep 02 14:17:07 CEST 2005
-module.version=3.0.2
+module.version=3.0.3
 module.build=2
 module.age=1
index 92bbf2b..7d0c63a 100644 (file)
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <time.h>
+#include <signal.h>
 #include <stdlib.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -173,7 +174,11 @@ int edg_wll_plain_write_full(
        int                             ct = -1;
        fd_set                  fds;
        struct timeval  timeout, before, after;
+       struct sigaction        sa,osa;
 
+       memset(&sa,0,sizeof(sa)); assert(sa.sa_handler == NULL);
+       sa.sa_handler = SIG_IGN;
+       sigaction(SIGPIPE,&sa,&osa);
 
        if ( to ) {
                memcpy(&timeout, to, sizeof(timeout));
@@ -204,5 +209,7 @@ end:
                if (to->tv_sec < 0) to->tv_sec = to->tv_usec = 0;
        }
 
+       sigaction(SIGPIPE,&osa,NULL);
+       if (errno == EPIPE) errno = ENOTCONN;
        return (errno)? -1: written;
 }