bug-inetutils
[Top][All Lists]
Advanced

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

Re: [bug-inetutils] already connected when closed


From: Alfred M. Szmidt
Subject: Re: [bug-inetutils] already connected when closed
Date: Sat, 14 Jul 2007 18:52:50 +0200 (CEST)

       I really do not like to ignore signals

   I hear you, but SIGPIPE is documented in this case, and we
   definitely don't want to just crash with it, and we're doing the
   right thing (disconnecting) if we see it.

You convinced me, I'll commit this in a couple of days (better to have
the code where the bug occurs instead of just special casing
setpeer()), could you test it once just to see that it works?

--- ftp.c       21 Oct 2006 18:23:46 +0200      1.30
+++ ftp.c       14 Jul 2007 18:51:17 +0200      
@@ -375,6 +375,8 @@ command (va_alist)
       return (0);
     }
   oldintr = signal (SIGINT, cmdabort);
+  /* Under wierd circumstances, we get a SIGPIPE from fflush().  */
+  signal (SIGPIPE, SIG_IGN);
 #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
   va_start (ap, fmt);
 #else
@@ -390,6 +392,7 @@ command (va_alist)
   if (abrtflag && oldintr != SIG_IGN)
     (*oldintr) (SIGINT);
   signal (SIGINT, oldintr);
+  signal (SIGPIPE, SIG_DFL);
   return (r);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]