Module Name: src
Committed By: mrg
Date: Mon Feb 4 04:09:13 UTC 2019
Modified Files:
src/usr.bin/ftp: cmds.c extern.h ftp.c main.c
Log Message:
- add justquit() that always exits. use it to avoid unreachable code.
To generate a diff of this commit:
cvs rdiff -u -r1.138 -r1.139 src/usr.bin/ftp/cmds.c
cvs rdiff -u -r1.80 -r1.81 src/usr.bin/ftp/extern.h
cvs rdiff -u -r1.167 -r1.168 src/usr.bin/ftp/ftp.c
cvs rdiff -u -r1.125 -r1.126 src/usr.bin/ftp/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/ftp/cmds.c
diff -u src/usr.bin/ftp/cmds.c:1.138 src/usr.bin/ftp/cmds.c:1.139
--- src/usr.bin/ftp/cmds.c:1.138 Mon Nov 20 21:11:36 2017
+++ src/usr.bin/ftp/cmds.c Mon Feb 4 04:09:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cmds.c,v 1.138 2017/11/20 21:11:36 kre Exp $ */
+/* $NetBSD: cmds.c,v 1.139 2019/02/04 04:09:13 mrg Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
#if 0
static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: cmds.c,v 1.138 2017/11/20 21:11:36 kre Exp $");
+__RCSID("$NetBSD: cmds.c,v 1.139 2019/02/04 04:09:13 mrg Exp $");
#endif
#endif /* not lint */
@@ -1776,6 +1776,13 @@ quit(int argc, char *argv[])
exit(0);
}
+void __dead
+justquit(void)
+{
+
+ quit(0, NULL);
+}
+
/*
* Terminate session, but don't exit.
* May be called with 0, NULL.
@@ -2185,7 +2192,7 @@ LOOP:
}
break;
}
- /* intentional drop through */
+ /* FALLTHROUGH */
default:
*cp2++ = *cp1;
break;
Index: src/usr.bin/ftp/extern.h
diff -u src/usr.bin/ftp/extern.h:1.80 src/usr.bin/ftp/extern.h:1.81
--- src/usr.bin/ftp/extern.h:1.80 Wed Jul 4 06:09:37 2012
+++ src/usr.bin/ftp/extern.h Mon Feb 4 04:09:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.80 2012/07/04 06:09:37 is Exp $ */
+/* $NetBSD: extern.h,v 1.81 2019/02/04 04:09:13 mrg Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -173,6 +173,7 @@ void pswitch(int);
void put(int, char **);
void pwd(int, char **);
void quit(int, char **);
+void justquit(void) __dead;
void quote(int, char **);
void quote1(const char *, int, char **);
void recvrequest(const char *, const char *, const char *,
Index: src/usr.bin/ftp/ftp.c
diff -u src/usr.bin/ftp/ftp.c:1.167 src/usr.bin/ftp/ftp.c:1.168
--- src/usr.bin/ftp/ftp.c:1.167 Tue Oct 4 15:06:31 2016
+++ src/usr.bin/ftp/ftp.c Mon Feb 4 04:09:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ftp.c,v 1.167 2016/10/04 15:06:31 joerg Exp $ */
+/* $NetBSD: ftp.c,v 1.168 2019/02/04 04:09:13 mrg Exp $ */
/*-
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -92,7 +92,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-__RCSID("$NetBSD: ftp.c,v 1.167 2016/10/04 15:06:31 joerg Exp $");
+__RCSID("$NetBSD: ftp.c,v 1.168 2019/02/04 04:09:13 mrg Exp $");
#endif
#endif /* not lint */
@@ -1553,8 +1553,8 @@ initconn(void)
result = COMPLETE + 1;
break;
}
- /* FALLTHROUGH */
#ifdef INET6
+ /* FALLTHROUGH */
case AF_INET6:
if (!epsv6 || epsv6bad) {
result = COMPLETE + 1;
Index: src/usr.bin/ftp/main.c
diff -u src/usr.bin/ftp/main.c:1.125 src/usr.bin/ftp/main.c:1.126
--- src/usr.bin/ftp/main.c:1.125 Sun Mar 4 19:57:41 2018
+++ src/usr.bin/ftp/main.c Mon Feb 4 04:09:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.125 2018/03/04 19:57:41 dholland Exp $ */
+/* $NetBSD: main.c,v 1.126 2019/02/04 04:09:13 mrg Exp $ */
/*-
* Copyright (c) 1996-2015 The NetBSD Foundation, Inc.
@@ -98,7 +98,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 19
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-__RCSID("$NetBSD: main.c,v 1.125 2018/03/04 19:57:41 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.126 2019/02/04 04:09:13 mrg Exp $");
#endif
#endif /* not lint */
@@ -660,7 +660,7 @@ cmdscanner(void)
case -2: /* error */
if (fromatty)
putc('\n', ttyout);
- quit(0, NULL);
+ justquit();
/* NOTREACHED */
case -3: /* too long; try again */
fputs("Sorry, input line is too long.\n",
@@ -682,7 +682,7 @@ cmdscanner(void)
if (buf == NULL || num == 0) {
if (fromatty)
putc('\n', ttyout);
- quit(0, NULL);
+ justquit();
}
if (num >= sizeof(line)) {
fputs("Sorry, input line is too long.\n",