From owner-svn-src-all@freebsd.org Sun Feb 4 19:05:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0CDBEE9BD7; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 727196D981; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D4781E1B9; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14J5ESc092674; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14J5Eoe092670; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041905.w14J5Eoe092670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 19:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328858 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2018 19:05:15 -0000 Author: trasz Date: Sun Feb 4 19:05:13 2018 New Revision: 328858 URL: https://svnweb.freebsd.org/changeset/base/328858 Log: Sprinkle static; avoid nested externs. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/extern.h head/libexec/getty/main.c head/libexec/getty/subr.c Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/extern.h Sun Feb 4 19:05:13 2018 (r328858) @@ -35,6 +35,8 @@ struct delayval; struct termios; +extern char **environ; +extern char editedhost[]; extern char hostname[]; extern struct termios tmode, omode; extern struct gettyflags gettyflags[]; Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/main.c Sun Feb 4 19:05:13 2018 (r328858) @@ -93,23 +93,23 @@ struct termios omode; /* current mode */ struct termios tmode; -int crmod, digit, lower, upper; +static int crmod, digit, lower, upper; char hostname[MAXHOSTNAMELEN]; -char name[MAXLOGNAME*3]; -char dev[] = _PATH_DEV; -char ttyn[32]; +static char name[MAXLOGNAME*3]; +static char dev[] = _PATH_DEV; +static char ttyn[32]; #define OBUFSIZ 128 #define TABBUFSIZ 512 -char defent[TABBUFSIZ]; -char tabent[TABBUFSIZ]; -const char *tname; +static char defent[TABBUFSIZ]; +static char tabent[TABBUFSIZ]; +static const char *tname; -char *env[128]; +static char *env[128]; -char partab[] = { +static char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, @@ -150,7 +150,7 @@ static char *get_line(int); static void setttymode(int); static int opentty(const char *, int); -jmp_buf timeout; +static jmp_buf timeout; static void dingdong(int signo __unused) @@ -159,7 +159,7 @@ dingdong(int signo __unused) longjmp(timeout, 1); } -jmp_buf intrupt; +static jmp_buf intrupt; static void interrupt(int signo __unused) @@ -181,7 +181,6 @@ timeoverrun(int signo __unused) int main(int argc, char *argv[]) { - extern char **environ; int first_sleep = 1, first_time = 1; struct rlimit limit; int rval; @@ -666,8 +665,8 @@ puts(const char *s) putchr(*s++); } -char outbuf[OBUFSIZ]; -int obufcnt = 0; +static char outbuf[OBUFSIZ]; +static int obufcnt = 0; static void putchr(int cc) @@ -733,7 +732,6 @@ get_line(int fd) static void putf(const char *cp) { - extern char editedhost[]; time_t t; char *slash, db[100]; Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/subr.c Sun Feb 4 19:05:13 2018 (r328858) @@ -588,7 +588,7 @@ makeenv(char *env[]) * baud rate. This string indicates the user's actual speed. * The routine below returns the terminal type mapped from derived speed. */ -struct portselect { +static struct portselect { const char *ps_baud; const char *ps_type; } portspeeds[] = {