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: Sun, 15 Jul 2007 12:01:06 -0500

    could you test it once just to see that it works?

Worked fine, except there's a typo in the comment :).  Fixed below.
Also, here again is the change to cmds.c to send the NOOP.

Thanks,
Karl

Index: cmds.c
===================================================================
RCS file: /sources/inetutils/inetutils/ftp/cmds.c,v
retrieving revision 1.33
diff -c -2 -r1.33 cmds.c
*** cmds.c      29 Jun 2007 16:29:34 -0000      1.33
--- cmds.c      15 Jul 2007 16:38:48 -0000
***************
*** 170,175 ****
    int port;
  
!   if (connected)
      disconnect (0, 0);
    if (argc < 2)
      another (&argc, &argv, "to");
--- 170,181 ----
    int port;
  
!   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");
Index: ftp.c
===================================================================
RCS file: /sources/inetutils/inetutils/ftp/ftp.c,v
retrieving revision 1.30
diff -c -2 -r1.30 ftp.c
*** ftp.c       21 Oct 2006 18:08:45 -0000      1.30
--- ftp.c       15 Jul 2007 16:38:52 -0000
***************
*** 376,379 ****
--- 376,381 ----
      }
    oldintr = signal (SIGINT, cmdabort);
+   /* Under weird circumstances, we get a SIGPIPE from fflush().  */
+   signal (SIGPIPE, SIG_IGN);
  #if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
    va_start (ap, fmt);
***************
*** 391,394 ****
--- 393,397 ----
      (*oldintr) (SIGINT);
    signal (SIGINT, oldintr);
+   signal (SIGPIPE, SIG_DFL);
    return (r);
  }




reply via email to

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