minor fixes from ut-sally
authorRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 12 Mar 1985 05:31:47 +0000 (21:31 -0800)
committerRalph Campbell <ralph@ucbvax.Berkeley.EDU>
Tue, 12 Mar 1985 05:31:47 +0000 (21:31 -0800)
SCCS-vsn: usr.bin/ftp/cmds.c 4.11
SCCS-vsn: usr.bin/ftp/cmdtab.c 4.8
SCCS-vsn: usr.bin/ftp/ftp.c 4.16

usr/src/usr.bin/ftp/cmds.c
usr/src/usr.bin/ftp/cmdtab.c
usr/src/usr.bin/ftp/ftp.c

index e7dae4c..03daee1 100644 (file)
@@ -1,12 +1,11 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cmds.c     4.10 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmds.c     4.11 (Berkeley) %G%";
 #endif
 
 /*
  * FTP User Program -- Command Routines.
  */
 #include <sys/param.h>
 #endif
 
 /*
  * FTP User Program -- Command Routines.
  */
 #include <sys/param.h>
-#include <sys/stat.h>
 #include <sys/socket.h>
 
 #include <arpa/ftp.h>
 #include <sys/socket.h>
 
 #include <arpa/ftp.h>
@@ -200,6 +199,9 @@ setstruct(argc, argv)
        printf("We only support %s structure, sorry.\n", structname);
 }
 
        printf("We only support %s structure, sorry.\n", structname);
 }
 
+/*
+ * Send a single file.
+ */
 put(argc, argv)
        int argc;
        char *argv[];
 put(argc, argv)
        int argc;
        char *argv[];
@@ -926,7 +928,8 @@ rmthelp(argc, argv)
 quit()
 {
 
 quit()
 {
 
-       disconnect();
+       if (connected)
+               disconnect();
        exit(0);
 }
 
        exit(0);
 }
 
index 3c2fbe3..5d897ba 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cmdtab.c   4.7 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmdtab.c   4.8 (Berkeley) %G%";
 #endif
 
 #include "ftp_var.h"
 #endif
 
 #include "ftp_var.h"
@@ -109,4 +109,4 @@ struct cmd cmdtab[] = {
        { 0 },
 };
 
        { 0 },
 };
 
-int    NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
+int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;
index 09bd0ef..15b9f15 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)ftp.c      4.15 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftp.c      4.16 (Berkeley) %G%";
 #endif
 
 #include <sys/param.h>
 #endif
 
 #include <sys/param.h>
@@ -59,7 +59,7 @@ hookup(host, port)
        }
        hostname = hp->h_name;
        hisctladdr.sin_family = hp->h_addrtype;
        }
        hostname = hp->h_name;
        hisctladdr.sin_family = hp->h_addrtype;
-       s = socket(hp->h_addrtype, SOCK_STREAM, 0, 0);
+       s = socket(hp->h_addrtype, SOCK_STREAM, 0);
        if (s < 0) {
                perror("ftp: socket");
                return (0);
        if (s < 0) {
                perror("ftp: socket");
                return (0);
@@ -488,7 +488,7 @@ noport:
                data_addr.sin_port = 0; /* let system pick one */ 
        if (data != -1)
                (void) close (data);
                data_addr.sin_port = 0; /* let system pick one */ 
        if (data != -1)
                (void) close (data);
-       data = socket(AF_INET, SOCK_STREAM, 0, 0);
+       data = socket(AF_INET, SOCK_STREAM, 0);
        if (data < 0) {
                perror("ftp: socket");
                return (1);
        if (data < 0) {
                perror("ftp: socket");
                return (1);