remove unused setebcdic() to make lint happier
authorRick Adams <rick@ucbvax.Berkeley.EDU>
Wed, 31 May 1989 01:12:48 +0000 (17:12 -0800)
committerRick Adams <rick@ucbvax.Berkeley.EDU>
Wed, 31 May 1989 01:12:48 +0000 (17:12 -0800)
prefix local error messages with "local:" to lessen user confusion.

SCCS-vsn: usr.bin/ftp/cmds.c 5.21
SCCS-vsn: usr.bin/ftp/ftp.c 5.31

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

index 40aa8b1..a72dfb9 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)cmds.c     5.20 (Berkeley) %G%";
+static char sccsid[] = "@(#)cmds.c     5.21 (Berkeley) %G%";
 #endif /* not lint */
 
 /*
 #endif /* not lint */
 
 /*
@@ -47,6 +47,8 @@ extern        char *remglob();
 extern char *getenv();
 extern char *index();
 extern char *rindex();
 extern char *getenv();
 extern char *index();
 extern char *rindex();
+extern char *strerror();
+extern int  errno;
 extern char reply_string[];
 
 char *mname;
 extern char reply_string[];
 
 char *mname;
@@ -295,16 +297,6 @@ settenex()
        settype(2, stype);
 }
 
        settype(2, stype);
 }
 
-/*
- * Set ebcdic transfer type.
- */
-/*VARARGS*/
-setebcdic()
-{
-       stype[1] = "ebcdic";
-       settype(2, stype);
-}
-
 /*
  * Set file transfer mode.
  */
 /*
  * Set file transfer mode.
  */
@@ -993,7 +985,7 @@ lcd(argc, argv)
                return;
        }
        if (chdir(argv[1]) < 0) {
                return;
        }
        if (chdir(argv[1]) < 0) {
-               perror(argv[1]);
+               fprintf(stderr, "local: %s: %s\n", argv[1], strerror(errno));
                code = -1;
                return;
        }
                code = -1;
                return;
        }
index 4bdee1d..7a4986b 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)ftp.c      5.30 (Berkeley) %G%";
+static char sccsid[] = "@(#)ftp.c      5.31 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -50,6 +50,9 @@ struct        sockaddr_in myctladdr;
 uid_t  getuid();
 sig_t  lostpeer();
 
 uid_t  getuid();
 sig_t  lostpeer();
 
+extern char *strerror();
+extern int errno;
+
 FILE   *cin, *cout;
 FILE   *dataconn();
 
 FILE   *cin, *cout;
 FILE   *dataconn();
 
@@ -469,7 +472,8 @@ sendrequest(cmd, local, remote, printnames)
        } else {
                fin = fopen(local, "r");
                if (fin == NULL) {
        } else {
                fin = fopen(local, "r");
                if (fin == NULL) {
-                       perror(local);
+                       fprintf(stderr, "local: %s: %s\n", local,
+                               strerror(errno));
                        (void) signal(SIGINT, oldintr);
                        code = -1;
                        return;
                        (void) signal(SIGINT, oldintr);
                        code = -1;
                        return;
@@ -547,7 +551,8 @@ sendrequest(cmd, local, remote, printnames)
                        (void) fflush(stdout);
                }
                if (c < 0)
                        (void) fflush(stdout);
                }
                if (c < 0)
-                       perror(local);
+                       fprintf(stderr, "local: %s: %s\n", local,
+                               strerror(errno));
                if (d <= 0) {
                        if (d == 0)
                                fprintf(stderr, "netout: write returned 0?\n");
                if (d <= 0) {
                        if (d == 0)
                                fprintf(stderr, "netout: write returned 0?\n");
@@ -584,7 +589,8 @@ sendrequest(cmd, local, remote, printnames)
                        (void) fflush(stdout);
                }
                if (ferror(fin))
                        (void) fflush(stdout);
                }
                if (ferror(fin))
-                       perror(local);
+                       fprintf(stderr, "local: %s: %s\n", local,
+                               strerror(errno));
                if (ferror(dout)) {
                        if (errno != EPIPE)
                                perror("netout");
                if (ferror(dout)) {
                        if (errno != EPIPE)
                                perror("netout");
@@ -687,7 +693,8 @@ recvrequest(cmd, local, remote, mode, printnames)
                        char *dir = rindex(local, '/');
 
                        if (errno != ENOENT && errno != EACCES) {
                        char *dir = rindex(local, '/');
 
                        if (errno != ENOENT && errno != EACCES) {
-                               perror(local);
+                               fprintf(stderr, "local: %s: %s\n", local,
+                                       strerror(errno));
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
@@ -698,14 +705,17 @@ recvrequest(cmd, local, remote, mode, printnames)
                        if (dir != NULL)
                                *dir = '/';
                        if (d < 0) {
                        if (dir != NULL)
                                *dir = '/';
                        if (d < 0) {
-                               perror(local);
+                               fprintf(stderr, "local: %s: %s\n", local,
+                                       strerror(errno));
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
                        }
                        if (!runique && errno == EACCES &&
                            chmod(local, 0600) < 0) {
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
                        }
                        if (!runique && errno == EACCES &&
                            chmod(local, 0600) < 0) {
-                               perror(local);
+                               fprintf(stderr, "local: %s: %s\n", local,
+                                       strerror(errno));
+                               (void) signal(SIGINT, oldintr);
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
                                (void) signal(SIGINT, oldintr);
                                code = -1;
                                return;
@@ -765,7 +775,8 @@ recvrequest(cmd, local, remote, mode, printnames)
        } else {
                fout = fopen(local, mode);
                if (fout == NULL) {
        } else {
                fout = fopen(local, mode);
                if (fout == NULL) {
-                       perror(local);
+                       fprintf(stderr, "local: %s: %s\n", local,
+                               strerror(errno));
                        goto abort;
                }
                closefunc = fclose;
                        goto abort;
                }
                closefunc = fclose;
@@ -868,7 +879,8 @@ break2:
                        bytes = -1;
                }
                if (ferror(fout))
                        bytes = -1;
                }
                if (ferror(fout))
-                       perror(local);
+                       fprintf(stderr, "local: %s: %s\n", local,
+                               strerror(errno));
                break;
        }
        if (closefunc != NULL)
                break;
        }
        if (closefunc != NULL)
@@ -1305,7 +1317,7 @@ gunique(local)
        if (cp)
                *cp = '/';
        if (d < 0) {
        if (cp)
                *cp = '/';
        if (d < 0) {
-               perror(local);
+               fprintf(stderr, "local: %s: %s\n", local, strerror(errno));
                return((char *) 0);
        }
        (void) strcpy(new, local);
                return((char *) 0);
        }
        (void) strcpy(new, local);