Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Aug 2021 23:22:11 GMT
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 60d0fd063d34 - stable/11 - ftpd: delete dead code
Message-ID:  <202108222322.17MNMBOY070042@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/11 has been updated by asomers:

URL: https://cgit.FreeBSD.org/src/commit/?id=60d0fd063d3497d94f4015fc407f86b13a74b2ff

commit 60d0fd063d3497d94f4015fc407f86b13a74b2ff
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2021-07-27 18:14:00 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2021-08-22 23:22:00 +0000

    ftpd: delete dead code
    
    Delete code killed by SVN r13139 in 1996.  Little chance that it would
    still compile today.
    
    PR:             257317
    Reported by:    Alan Shearer <sakison@gmail.com>
    Sponsored by:   Axcient
    
    (cherry picked from commit 674400eb20b65369a88b1cb778d729bc297832c9)
---
 libexec/ftpd/extern.h |  3 ---
 libexec/ftpd/ftpd.c   | 49 -------------------------------------------------
 2 files changed, 52 deletions(-)

diff --git a/libexec/ftpd/extern.h b/libexec/ftpd/extern.h
index 9d56cb235b4c..022c97f6b6a9 100644
--- a/libexec/ftpd/extern.h
+++ b/libexec/ftpd/extern.h
@@ -57,9 +57,6 @@ char   *renamefrom(char *);
 void	reply(int, const char *, ...) __printflike(2, 3);
 void	retrieve(char *, char *);
 void	send_file_list(char *);
-#ifdef OLD_SETPROCTITLE
-void	setproctitle(const char *, ...);
-#endif
 void	statcmd(void);
 void	statfilecmd(char *);
 void	store(char *, char *, int);
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index c057fdc7b500..67181f641494 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -203,10 +203,6 @@ int	swaitmax = SWAITMAX;
 int	swaitint = SWAITINT;
 
 #ifdef SETPROCTITLE
-#ifdef OLD_SETPROCTITLE
-char	**Argv = NULL;		/* pointer to argument vector */
-char	*LastArgv = NULL;	/* end of argv */
-#endif /* OLD_SETPROCTITLE */
 char	proctitle[LINE_MAX];	/* initial part of title */
 #endif /* SETPROCTITLE */
 
@@ -278,16 +274,6 @@ main(int argc, char *argv[], char **envp)
 	sigemptyset(&sa.sa_mask);
 	sa.sa_flags = SA_RESTART;
 
-#ifdef OLD_SETPROCTITLE
-	/*
-	 *  Save start and extent of argv for setproctitle.
-	 */
-	Argv = argv;
-	while (*envp)
-		envp++;
-	LastArgv = envp[-1] + strlen(envp[-1]);
-#endif /* OLD_SETPROCTITLE */
-
 	/*
 	 * Prevent diagnostic messages from appearing on stderr.
 	 * We run as a daemon or from inetd; in both cases, there's
@@ -3326,41 +3312,6 @@ reapchild(int signo)
 	while (waitpid(-1, NULL, WNOHANG) > 0);
 }
 
-#ifdef OLD_SETPROCTITLE
-/*
- * Clobber argv so ps will show what we're doing.  (Stolen from sendmail.)
- * Warning, since this is usually started from inetd.conf, it often doesn't
- * have much of an environment or arglist to overwrite.
- */
-void
-setproctitle(const char *fmt, ...)
-{
-	int i;
-	va_list ap;
-	char *p, *bp, ch;
-	char buf[LINE_MAX];
-
-	va_start(ap, fmt);
-	(void)vsnprintf(buf, sizeof(buf), fmt, ap);
-
-	/* make ps print our process name */
-	p = Argv[0];
-	*p++ = '-';
-
-	i = strlen(buf);
-	if (i > LastArgv - p - 2) {
-		i = LastArgv - p - 2;
-		buf[i] = '\0';
-	}
-	bp = buf;
-	while (ch = *bp++)
-		if (ch != '\n' && ch != '\r')
-			*p++ = ch;
-	while (p < LastArgv)
-		*p++ = ' ';
-}
-#endif /* OLD_SETPROCTITLE */
-
 static void
 appendf(char **strp, char *fmt, ...)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202108222322.17MNMBOY070042>