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: Karl Berry
Subject: Re: [bug-inetutils] already connected when closed
Date: Wed, 11 Jul 2007 16:50:20 -0500

    Try doing this (somewhere) instead: signal (SIGPIPE, SIG_IGN);

Yep.  I put that just before the NOOP, and now it works!  I would guess
the handler should be saved and restored, but I'll leave that to you.
My diff from cvs below.

Thanks for persevering with me on this ...
karl

--- cmds.c      29 Jun 2007 16:29:34 -0000      1.33
+++ cmds.c      11 Jul 2007 21:46:55 -0000
@@ -170,6 +170,13 @@
   int port;
 
-  if (connected)
+  signal (SIGPIPE, SIG_IGN);
+  if (connected && command ("NOOP") != COMPLETE) {
     disconnect (0, 0);
+  } else if (connected) {
+    printf ("Already connected to %s, use close first.\n", hostname);
+    code = -1;
+    return;
+  }
+
   if (argc < 2)
     another (&argc, &argv, "to");




reply via email to

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