From owner-svn-src-head@freebsd.org Sun Feb 4 13:55:21 2018 Return-Path: Delivered-To: svn-src-head@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 6B60FED7E8E; Sun, 4 Feb 2018 13:55:21 +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 0D06880C98; Sun, 4 Feb 2018 13:55:21 +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 DDD311B012; Sun, 4 Feb 2018 13:55:20 +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 w14DtK53037023; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DtKJt037022; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041355.w14DtKJt037022@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 13:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328843 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Feb 2018 13:55:21 -0000 Author: trasz Date: Sun Feb 4 13:55:20 2018 New Revision: 328843 URL: https://svnweb.freebsd.org/changeset/base/328843 Log: Reduce code duplication; no functional changes. Obtained from: NetBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/init.c Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sun Feb 4 13:54:43 2018 (r328842) +++ head/libexec/getty/init.c Sun Feb 4 13:55:20 2018 (r328843) @@ -52,31 +52,33 @@ static char nullstr[] = ""; static char loginprg[] = _PATH_LOGIN; static char datefmt[] = "%+"; +#define M(a) (&omode.c_cc[a]) + struct gettystrs gettystrs[] = { { "nx" }, /* next table */ { "cl" }, /* screen clear characters */ { "im" }, /* initial message */ { "lm", loginmsg }, /* login message */ - { "er", &omode.c_cc[VERASE] }, /* erase character */ - { "kl", &omode.c_cc[VKILL] }, /* kill character */ - { "et", &omode.c_cc[VEOF] }, /* eof chatacter (eot) */ + { "er", M(VERASE) }, /* erase character */ + { "kl", M(VKILL) }, /* kill character */ + { "et", M(VEOF) }, /* eof chatacter (eot) */ { "pc", nullstr }, /* pad character */ { "tt" }, /* terminal type */ { "ev" }, /* environment */ { "lo", loginprg }, /* login program */ { "hn", hostname }, /* host name */ { "he" }, /* host name edit */ - { "in", &omode.c_cc[VINTR] }, /* interrupt char */ - { "qu", &omode.c_cc[VQUIT] }, /* quit char */ - { "xn", &omode.c_cc[VSTART] }, /* XON (start) char */ - { "xf", &omode.c_cc[VSTOP] }, /* XOFF (stop) char */ - { "bk", &omode.c_cc[VEOL] }, /* brk char (alt \n) */ - { "su", &omode.c_cc[VSUSP] }, /* suspend char */ - { "ds", &omode.c_cc[VDSUSP] }, /* delayed suspend */ - { "rp", &omode.c_cc[VREPRINT] },/* reprint char */ - { "fl", &omode.c_cc[VDISCARD] },/* flush output */ - { "we", &omode.c_cc[VWERASE] }, /* word erase */ - { "ln", &omode.c_cc[VLNEXT] }, /* literal next */ + { "in", M(VINTR) }, /* interrupt char */ + { "qu", M(VQUIT) }, /* quit char */ + { "xn", M(VSTART) }, /* XON (start) char */ + { "xf", M(VSTOP) }, /* XOFF (stop) char */ + { "bk", M(VEOL) }, /* brk char (alt \n) */ + { "su", M(VSUSP) }, /* suspend char */ + { "ds", M(VDSUSP) }, /* delayed suspend */ + { "rp", M(VREPRINT) }, /* reprint char */ + { "fl", M(VDISCARD) }, /* flush output */ + { "we", M(VWERASE) }, /* word erase */ + { "ln", M(VLNEXT) }, /* literal next */ { "Lo" }, /* locale for strftime() */ { "pp" }, /* ppp login program */ { "if" }, /* sysv-like 'issue' filename */