Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC)
- Fix for possible unset uid/gid in toproto
- Fix for default mtree style
- Update libelf
- Importing libexecinfo
- Resynchronize GCC, mpc, gmp, mpfr
- build.sh: Replace params with show-params.
This has been done as the make target has been renamed in the same
way, while a new target named params has been added. This new
target generates a file containing all the parameters, instead of
printing it on the console.
- Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org)
get getservbyport() out of the inner loop
Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
# $NetBSD: Makefile,v 1.19 2010/02/03 15:34:43 roy Exp $
|
||||
# $NetBSD: Makefile,v 1.20 2013/08/11 05:42:41 dholland Exp $
|
||||
# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
|
||||
|
||||
WARNS?= 2 # XXX: many const & sign-compare issues
|
||||
|
||||
PROG= getty
|
||||
SRCS= main.c init.c subr.c
|
||||
DPADD+= ${LIBUTIL} ${LIBTERMINFO}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: extern.h,v 1.6 2003/08/07 09:46:41 agc Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.7 2013/08/11 05:42:41 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993
|
||||
@@ -34,17 +34,17 @@
|
||||
struct delayval;
|
||||
|
||||
int adelay(int, struct delayval *);
|
||||
char *autobaud(void);
|
||||
const char *autobaud(void);
|
||||
int delaybits(void);
|
||||
void edithost(char *);
|
||||
void edithost(const char *);
|
||||
void gendefaults(void);
|
||||
int getent(char *, char *);
|
||||
int getflag(char *);
|
||||
long getnum(char *);
|
||||
char *getstr(char *, char **);
|
||||
void gettable(char *, char *);
|
||||
void gettable(const char *, char *);
|
||||
void makeenv(char *[]);
|
||||
char *portselector(void);
|
||||
const char *portselector(void);
|
||||
void set_ttydefaults(int);
|
||||
void setchars(void);
|
||||
void setdefaults(void);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: getty.8,v 1.17 2003/08/07 09:46:42 agc Exp $
|
||||
.\" $NetBSD: getty.8,v 1.18 2013/05/29 15:02:12 wiz Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1980, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -29,7 +29,7 @@
|
||||
.\"
|
||||
.\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93
|
||||
.\"
|
||||
.Dd December 12, 1998
|
||||
.Dd May 29, 2013
|
||||
.Dt GETTY 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -145,6 +145,7 @@ of processes that dial out on that tty.
|
||||
.Bl -tag -width /var/spool/lock/LCK..ttyXX -compact
|
||||
.It Pa /etc/gettytab
|
||||
.It Pa /etc/ttys
|
||||
.It Pa /usr/libexec/getty
|
||||
.It Pa /var/spool/lock/LCK..ttyXX
|
||||
.El
|
||||
.Sh DIAGNOSTICS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: gettytab.h,v 1.16 2006/11/16 04:31:24 christos Exp $ */
|
||||
/* $NetBSD: gettytab.h,v 1.17 2013/08/11 05:42:41 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993, 1994
|
||||
@@ -35,20 +35,20 @@
|
||||
* Getty description definitions.
|
||||
*/
|
||||
struct gettystrs {
|
||||
char *field; /* name to lookup in gettytab */
|
||||
char *defalt; /* value we find by looking in defaults */
|
||||
const char *field; /* name to lookup in gettytab */
|
||||
const char *defalt; /* value we find by looking in defaults */
|
||||
char *value; /* value that we find there */
|
||||
};
|
||||
|
||||
struct gettynums {
|
||||
char *field; /* name to lookup */
|
||||
const char *field; /* name to lookup */
|
||||
long defalt; /* number we find in defaults */
|
||||
long value; /* number we find there */
|
||||
int set; /* we actually got this one */
|
||||
};
|
||||
|
||||
struct gettyflags {
|
||||
char *field; /* name to lookup */
|
||||
const char *field; /* name to lookup */
|
||||
char invrt; /* name existing in gettytab --> false */
|
||||
char defalt; /* true/false in defaults */
|
||||
char value; /* true/false flag */
|
||||
|
||||
+85
-84
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: init.c,v 1.17 2007/12/03 09:54:24 isaki Exp $ */
|
||||
/* $NetBSD: init.c,v 1.18 2013/08/11 05:42:41 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)init.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: init.c,v 1.17 2007/12/03 09:54:24 isaki Exp $");
|
||||
__RCSID("$NetBSD: init.c,v 1.18 2013/08/11 05:42:41 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@@ -44,6 +44,7 @@ __RCSID("$NetBSD: init.c,v 1.17 2007/12/03 09:54:24 isaki Exp $");
|
||||
* Melbourne getty.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "gettytab.h"
|
||||
@@ -55,92 +56,92 @@ extern char hostname[];
|
||||
#define M(a) ((char *)&tmode.c_cc[a])
|
||||
|
||||
struct gettystrs gettystrs[] = {
|
||||
{ "nx" }, /* next table */
|
||||
{ "cl" }, /* screen clear characters */
|
||||
{ "im" }, /* initial message */
|
||||
{ "lm", "login: " }, /* login message */
|
||||
{ "er", M(VERASE) }, /* erase character */
|
||||
{ "kl", M(VKILL) }, /* kill character */
|
||||
{ "et", M(VEOF) }, /* eof chatacter (eot) */
|
||||
{ "pc", "" }, /* pad character */
|
||||
{ "tt" }, /* terminal type */
|
||||
{ "ev" }, /* environment */
|
||||
{ "lo", _PATH_LOGIN }, /* login program */
|
||||
{ "hn", hostname }, /* host name */
|
||||
{ "he" }, /* host name edit */
|
||||
{ "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 */
|
||||
{ "st", M(VSTATUS) }, /* status */
|
||||
{ "b2", M(VEOL2) }, /* alt brk char */
|
||||
{ "pp" }, /* ppp login program */
|
||||
{ "if" }, /* sysv-like 'issue' filename */
|
||||
{ "al" }, /* user to auto-login */
|
||||
{ 0 }
|
||||
{ "nx", NULL, NULL }, /* next table */
|
||||
{ "cl", NULL, NULL }, /* screen clear characters */
|
||||
{ "im", NULL, NULL }, /* initial message */
|
||||
{ "lm", "login: ", NULL }, /* login message */
|
||||
{ "er", M(VERASE), NULL }, /* erase character */
|
||||
{ "kl", M(VKILL), NULL }, /* kill character */
|
||||
{ "et", M(VEOF), NULL }, /* eof chatacter (eot) */
|
||||
{ "pc", "", NULL }, /* pad character */
|
||||
{ "tt", NULL, NULL }, /* terminal type */
|
||||
{ "ev", NULL, NULL }, /* environment */
|
||||
{ "lo", _PATH_LOGIN, NULL }, /* login program */
|
||||
{ "hn", hostname, NULL }, /* host name */
|
||||
{ "he", NULL, NULL }, /* host name edit */
|
||||
{ "in", M(VINTR), NULL }, /* interrupt char */
|
||||
{ "qu", M(VQUIT), NULL }, /* quit char */
|
||||
{ "xn", M(VSTART), NULL }, /* XON (start) char */
|
||||
{ "xf", M(VSTOP), NULL }, /* XOFF (stop) char */
|
||||
{ "bk", M(VEOL), NULL }, /* brk char (alt \n) */
|
||||
{ "su", M(VSUSP), NULL }, /* suspend char */
|
||||
{ "ds", M(VDSUSP), NULL }, /* delayed suspend */
|
||||
{ "rp", M(VREPRINT), NULL }, /* reprint char */
|
||||
{ "fl", M(VDISCARD), NULL }, /* flush output */
|
||||
{ "we", M(VWERASE), NULL }, /* word erase */
|
||||
{ "ln", M(VLNEXT), NULL }, /* literal next */
|
||||
{ "st", M(VSTATUS), NULL }, /* status */
|
||||
{ "b2", M(VEOL2), NULL }, /* alt brk char */
|
||||
{ "pp", NULL, NULL }, /* ppp login program */
|
||||
{ "if", NULL, NULL }, /* sysv-like 'issue' filename */
|
||||
{ "al", NULL, NULL }, /* user to auto-login */
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
struct gettynums gettynums[] = {
|
||||
{ "is" }, /* input speed */
|
||||
{ "os" }, /* output speed */
|
||||
{ "sp" }, /* both speeds */
|
||||
{ "nd" }, /* newline delay */
|
||||
{ "cd" }, /* carriage-return delay */
|
||||
{ "td" }, /* tab delay */
|
||||
{ "fd" }, /* form-feed delay */
|
||||
{ "bd" }, /* backspace delay */
|
||||
{ "to" }, /* timeout */
|
||||
{ "f0" }, /* output flags */
|
||||
{ "f1" }, /* input flags */
|
||||
{ "f2" }, /* user mode flags */
|
||||
{ "pf" }, /* delay before flush at 1st prompt */
|
||||
{ "c0" }, /* output c_flags */
|
||||
{ "c1" }, /* input c_flags */
|
||||
{ "c2" }, /* user mode c_flags */
|
||||
{ "i0" }, /* output i_flags */
|
||||
{ "i1" }, /* input i_flags */
|
||||
{ "i2" }, /* user mode i_flags */
|
||||
{ "l0" }, /* output l_flags */
|
||||
{ "l1" }, /* input l_flags */
|
||||
{ "l2" }, /* user mode l_flags */
|
||||
{ "o0" }, /* output o_flags */
|
||||
{ "o1" }, /* input o_flags */
|
||||
{ "o2" }, /* user mode o_flags */
|
||||
{ 0 }
|
||||
{ "is", 0,0,0 }, /* input speed */
|
||||
{ "os", 0,0,0 }, /* output speed */
|
||||
{ "sp", 0,0,0 }, /* both speeds */
|
||||
{ "nd", 0,0,0 }, /* newline delay */
|
||||
{ "cd", 0,0,0 }, /* carriage-return delay */
|
||||
{ "td", 0,0,0 }, /* tab delay */
|
||||
{ "fd", 0,0,0 }, /* form-feed delay */
|
||||
{ "bd", 0,0,0 }, /* backspace delay */
|
||||
{ "to", 0,0,0 }, /* timeout */
|
||||
{ "f0", 0,0,0 }, /* output flags */
|
||||
{ "f1", 0,0,0 }, /* input flags */
|
||||
{ "f2", 0,0,0 }, /* user mode flags */
|
||||
{ "pf", 0,0,0 }, /* delay before flush at 1st prompt */
|
||||
{ "c0", 0,0,0 }, /* output c_flags */
|
||||
{ "c1", 0,0,0 }, /* input c_flags */
|
||||
{ "c2", 0,0,0 }, /* user mode c_flags */
|
||||
{ "i0", 0,0,0 }, /* output i_flags */
|
||||
{ "i1", 0,0,0 }, /* input i_flags */
|
||||
{ "i2", 0,0,0 }, /* user mode i_flags */
|
||||
{ "l0", 0,0,0 }, /* output l_flags */
|
||||
{ "l1", 0,0,0 }, /* input l_flags */
|
||||
{ "l2", 0,0,0 }, /* user mode l_flags */
|
||||
{ "o0", 0,0,0 }, /* output o_flags */
|
||||
{ "o1", 0,0,0 }, /* input o_flags */
|
||||
{ "o2", 0,0,0 }, /* user mode o_flags */
|
||||
{ 0,0,0,0 }
|
||||
};
|
||||
|
||||
struct gettyflags gettyflags[] = {
|
||||
{ "ht", 0 }, /* has tabs */
|
||||
{ "nl", 1 }, /* has newline char */
|
||||
{ "ep", 0 }, /* even parity */
|
||||
{ "op", 0 }, /* odd parity */
|
||||
{ "ap", 0 }, /* any parity */
|
||||
{ "ec", 1 }, /* no echo */
|
||||
{ "co", 0 }, /* console special */
|
||||
{ "cb", 0 }, /* crt backspace */
|
||||
{ "ck", 0 }, /* crt kill */
|
||||
{ "ce", 0 }, /* crt erase */
|
||||
{ "pe", 0 }, /* printer erase */
|
||||
{ "rw", 1 }, /* don't use raw */
|
||||
{ "xc", 1 }, /* don't ^X ctl chars */
|
||||
{ "lc", 0 }, /* terminal las lower case */
|
||||
{ "uc", 0 }, /* terminal has no lower case */
|
||||
{ "ig", 0 }, /* ignore garbage */
|
||||
{ "ps", 0 }, /* do port selector speed select */
|
||||
{ "hc", 1 }, /* don't set hangup on close */
|
||||
{ "ub", 0 }, /* unbuffered output */
|
||||
{ "ab", 0 }, /* auto-baud detect with '\r' */
|
||||
{ "dx", 0 }, /* set decctlq */
|
||||
{ "np", 0 }, /* no parity at all (8bit chars) */
|
||||
{ "mb", 0 }, /* do MDMBUF flow control */
|
||||
{ "cs", 0 }, /* clear screen based on term type */
|
||||
{ "nn", 0 }, /* don't prompt for login name */
|
||||
{ 0 }
|
||||
{ "ht", 0, 0,0,0 }, /* has tabs */
|
||||
{ "nl", 1, 0,0,0 }, /* has newline char */
|
||||
{ "ep", 0, 0,0,0 }, /* even parity */
|
||||
{ "op", 0, 0,0,0 }, /* odd parity */
|
||||
{ "ap", 0, 0,0,0 }, /* any parity */
|
||||
{ "ec", 1, 0,0,0 }, /* no echo */
|
||||
{ "co", 0, 0,0,0 }, /* console special */
|
||||
{ "cb", 0, 0,0,0 }, /* crt backspace */
|
||||
{ "ck", 0, 0,0,0 }, /* crt kill */
|
||||
{ "ce", 0, 0,0,0 }, /* crt erase */
|
||||
{ "pe", 0, 0,0,0 }, /* printer erase */
|
||||
{ "rw", 1, 0,0,0 }, /* don't use raw */
|
||||
{ "xc", 1, 0,0,0 }, /* don't ^X ctl chars */
|
||||
{ "lc", 0, 0,0,0 }, /* terminal las lower case */
|
||||
{ "uc", 0, 0,0,0 }, /* terminal has no lower case */
|
||||
{ "ig", 0, 0,0,0 }, /* ignore garbage */
|
||||
{ "ps", 0, 0,0,0 }, /* do port selector speed select */
|
||||
{ "hc", 1, 0,0,0 }, /* don't set hangup on close */
|
||||
{ "ub", 0, 0,0,0 }, /* unbuffered output */
|
||||
{ "ab", 0, 0,0,0 }, /* auto-baud detect with '\r' */
|
||||
{ "dx", 0, 0,0,0 }, /* set decctlq */
|
||||
{ "np", 0, 0,0,0 }, /* no parity at all (8bit chars) */
|
||||
{ "mb", 0, 0,0,0 }, /* do MDMBUF flow control */
|
||||
{ "cs", 0, 0,0,0 }, /* clear screen based on term type */
|
||||
{ "nn", 0, 0,0,0 }, /* don't prompt for login name */
|
||||
{ NULL,0,0,0,0 }
|
||||
};
|
||||
|
||||
+27
-25
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy Exp $ */
|
||||
/* $NetBSD: main.c,v 1.64 2013/08/12 13:54:33 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1980, 1993
|
||||
@@ -40,13 +40,11 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)main.c 8.1 (Berkeley) 6/20/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.64 2013/08/12 13:54:33 joerg Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/stat.h>
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/utsname.h>
|
||||
@@ -58,10 +56,12 @@ __RCSID("$NetBSD: main.c,v 1.59 2012/06/28 08:55:10 roy Exp $");
|
||||
#include <pwd.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include <term.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
#include <ttyent.h>
|
||||
#include <unistd.h>
|
||||
@@ -135,34 +135,34 @@ const unsigned char partab[] = {
|
||||
|
||||
static void clearscreen(void);
|
||||
|
||||
jmp_buf timeout;
|
||||
sigjmp_buf timeout;
|
||||
|
||||
static void
|
||||
__dead static void
|
||||
/*ARGSUSED*/
|
||||
dingdong(int signo)
|
||||
{
|
||||
|
||||
(void)alarm(0);
|
||||
(void)signal(SIGALRM, SIG_DFL);
|
||||
longjmp(timeout, 1);
|
||||
siglongjmp(timeout, 1);
|
||||
}
|
||||
|
||||
jmp_buf intrupt;
|
||||
sigjmp_buf intrupt;
|
||||
|
||||
static void
|
||||
__dead static void
|
||||
/*ARGSUSED*/
|
||||
interrupt(int signo)
|
||||
{
|
||||
|
||||
(void)signal(SIGINT, interrupt);
|
||||
longjmp(intrupt, 1);
|
||||
siglongjmp(intrupt, 1);
|
||||
}
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
/*
|
||||
* Action to take when getty is running too long.
|
||||
*/
|
||||
static void
|
||||
__dead static void
|
||||
/*ARGSUSED*/
|
||||
timeoverrun(int signo)
|
||||
{
|
||||
@@ -170,7 +170,7 @@ timeoverrun(int signo)
|
||||
syslog(LOG_ERR, "getty exiting due to excessive running time");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
static int getname(void);
|
||||
static void oflush(void);
|
||||
@@ -185,11 +185,14 @@ int
|
||||
main(int argc, char *argv[], char *envp[])
|
||||
{
|
||||
const char *progname;
|
||||
char *tname;
|
||||
int repcnt = 0, failopenlogged = 0, uugetty = 0, first_time = 1;
|
||||
int repcnt = 0, failopenlogged = 0, first_time = 1;
|
||||
struct rlimit limit;
|
||||
struct passwd *pw;
|
||||
int rval;
|
||||
/* this is used past the siglongjmp, so make sure it is not cached
|
||||
in registers that might become invalid. */
|
||||
volatile int uugetty = 0;
|
||||
const char * volatile tname = "default";
|
||||
|
||||
(void)signal(SIGINT, SIG_IGN);
|
||||
openlog("getty", LOG_PID, LOG_AUTH);
|
||||
@@ -214,12 +217,12 @@ main(int argc, char *argv[], char *envp[])
|
||||
/*
|
||||
* Limit running time to deal with broken or dead lines.
|
||||
*/
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
(void)signal(SIGXCPU, timeoverrun);
|
||||
limit.rlim_max = RLIM_INFINITY;
|
||||
limit.rlim_cur = GETTY_TIMEOUT;
|
||||
(void)setrlimit(RLIMIT_CPU, &limit);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
/*
|
||||
* The following is a work around for vhangup interactions
|
||||
@@ -257,9 +260,9 @@ main(int argc, char *argv[], char *envp[])
|
||||
if (strcmp(argv[0], "+") != 0) {
|
||||
(void)chown(ttyn, ttyowner, 0);
|
||||
(void)chmod(ttyn, 0600);
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
(void)revoke(ttyn);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
if (ttyaction(ttyn, "getty", "root"))
|
||||
syslog(LOG_WARNING, "%s: ttyaction failed",
|
||||
ttyn);
|
||||
@@ -298,7 +301,6 @@ main(int argc, char *argv[], char *envp[])
|
||||
|
||||
gettable("default", defent);
|
||||
gendefaults();
|
||||
tname = "default";
|
||||
if (argc > 1)
|
||||
tname = argv[1];
|
||||
for (;;) {
|
||||
@@ -314,7 +316,7 @@ main(int argc, char *argv[], char *envp[])
|
||||
#ifndef __minix
|
||||
(void)ioctl(0, FIONBIO, &off); /* turn off non-blocking mode */
|
||||
(void)ioctl(0, FIOASYNC, &off); /* ditto for async mode */
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
if (IS)
|
||||
(void)cfsetispeed(&tmode, (speed_t)IS);
|
||||
@@ -363,7 +365,7 @@ main(int argc, char *argv[], char *envp[])
|
||||
if (IM && *IM)
|
||||
putf(IM);
|
||||
oflush();
|
||||
if (setjmp(timeout)) {
|
||||
if (sigsetjmp(timeout, 1)) {
|
||||
tmode.c_ispeed = tmode.c_ospeed = 0;
|
||||
(void)tcsetattr(0, TCSANOW, &tmode);
|
||||
exit(1);
|
||||
@@ -430,9 +432,9 @@ main(int argc, char *argv[], char *envp[])
|
||||
|
||||
limit.rlim_max = RLIM_INFINITY;
|
||||
limit.rlim_cur = RLIM_INFINITY;
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
(void)setrlimit(RLIMIT_CPU, &limit);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
if (NN)
|
||||
(void)execle(LO, "login", AL ? "-fp" : "-p",
|
||||
NULL, env);
|
||||
@@ -463,7 +465,7 @@ getname(void)
|
||||
/*
|
||||
* Interrupt may happen if we use CBREAK mode
|
||||
*/
|
||||
if (setjmp(intrupt)) {
|
||||
if (sigsetjmp(intrupt, 1)) {
|
||||
(void)signal(SIGINT, SIG_IGN);
|
||||
return (0);
|
||||
}
|
||||
|
||||
+33
-33
@@ -1,4 +1,4 @@
|
||||
/* $NetBSD: subr.c,v 1.33 2006/11/16 04:31:24 christos Exp $ */
|
||||
/* $NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
@@ -34,26 +34,25 @@
|
||||
#if 0
|
||||
static char sccsid[] = "from: @(#)subr.c 8.1 (Berkeley) 6/4/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: subr.c,v 1.33 2006/11/16 04:31:24 christos Exp $");
|
||||
__RCSID("$NetBSD: subr.c,v 1.35 2013/08/11 16:36:30 dholland Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
* Melbourne getty.
|
||||
*/
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
#define COMPAT_43
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
#include <util.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "gettytab.h"
|
||||
@@ -61,15 +60,15 @@ __RCSID("$NetBSD: subr.c,v 1.33 2006/11/16 04:31:24 christos Exp $");
|
||||
|
||||
extern struct termios tmode, omode;
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
static void compatflags(long);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
/*
|
||||
* Get a table entry.
|
||||
*/
|
||||
void
|
||||
gettable(char *name, char *buf)
|
||||
gettable(const char *name, char *buf)
|
||||
{
|
||||
struct gettystrs *sp;
|
||||
struct gettynums *np;
|
||||
@@ -77,7 +76,7 @@ gettable(char *name, char *buf)
|
||||
long n;
|
||||
const char *dba[2];
|
||||
dba[0] = _PATH_GETTYTAB;
|
||||
dba[1] = 0;
|
||||
dba[1] = NULL;
|
||||
|
||||
if (cgetent(&buf, dba, name) != 0)
|
||||
return;
|
||||
@@ -142,7 +141,7 @@ setdefaults(void)
|
||||
|
||||
for (sp = gettystrs; sp->field; sp++)
|
||||
if (!sp->value)
|
||||
sp->value = sp->defalt;
|
||||
sp->value = sp->defalt ? estrdup(sp->defalt) : NULL;
|
||||
for (np = gettynums; np->field; np++)
|
||||
if (!np->set)
|
||||
np->value = np->defalt;
|
||||
@@ -284,12 +283,12 @@ setflags(int n)
|
||||
else
|
||||
CLR(cflag, HUPCL);
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
if (MB)
|
||||
SET(cflag, MDMBUF);
|
||||
else
|
||||
CLR(cflag, MDMBUF);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
if (NL) {
|
||||
SET(iflag, ICRNL);
|
||||
@@ -299,12 +298,12 @@ setflags(int n)
|
||||
CLR(oflag, ONLCR);
|
||||
}
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
if (!HT)
|
||||
SET(oflag, OXTABS|OPOST);
|
||||
else
|
||||
CLR(oflag, OXTABS);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
#ifdef XXX_DELAY
|
||||
SET(f, delaybits());
|
||||
@@ -336,7 +335,7 @@ setflags(int n)
|
||||
else
|
||||
CLR(lflag, ECHOE);
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
if (CK)
|
||||
SET(lflag, ECHOKE);
|
||||
else
|
||||
@@ -346,19 +345,19 @@ setflags(int n)
|
||||
SET(lflag, ECHOPRT);
|
||||
else
|
||||
CLR(lflag, ECHOPRT);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
if (EC)
|
||||
SET(lflag, ECHO);
|
||||
else
|
||||
CLR(lflag, ECHO);
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
if (XC)
|
||||
SET(lflag, ECHOCTL);
|
||||
else
|
||||
CLR(lflag, ECHOCTL);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
|
||||
if (DX)
|
||||
SET(lflag, IXANY);
|
||||
@@ -448,25 +447,24 @@ compatflags(long flags)
|
||||
SET(lflag, ECHOE);
|
||||
else
|
||||
CLR(lflag, ECHOE);
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
/* Nothing we can do with TILDE. */
|
||||
if (ISSET(flags, MDMBUF))
|
||||
SET(cflag, MDMBUF);
|
||||
else
|
||||
CLR(cflag, MDMBUF);
|
||||
#endif
|
||||
#endif /* !defined(__minix) */
|
||||
if (ISSET(flags, NOHANG))
|
||||
CLR(cflag, HUPCL);
|
||||
else
|
||||
SET(cflag, HUPCL);
|
||||
|
||||
#ifndef __minix
|
||||
#if !defined(__minix)
|
||||
if (ISSET(flags, CRTKIL))
|
||||
SET(lflag, ECHOKE);
|
||||
else
|
||||
CLR(lflag, ECHOKE);
|
||||
#endif
|
||||
|
||||
#endif /* !defined(__minix) */
|
||||
if (ISSET(flags, CTLECH))
|
||||
SET(lflag, ECHOCTL);
|
||||
else
|
||||
@@ -576,7 +574,7 @@ adelay(int ms, struct delayval *dp)
|
||||
char editedhost[MAXHOSTNAMELEN];
|
||||
|
||||
void
|
||||
edithost(char *pat)
|
||||
edithost(const char *pat)
|
||||
{
|
||||
char *host = HN;
|
||||
char *res = editedhost;
|
||||
@@ -647,8 +645,8 @@ makeenv(char *env[])
|
||||
* The routine below returns the terminal type mapped from derived speed.
|
||||
*/
|
||||
struct portselect {
|
||||
char *ps_baud;
|
||||
char *ps_type;
|
||||
const char *ps_baud;
|
||||
const char *ps_type;
|
||||
} portspeeds[] = {
|
||||
{ "B110", "std.110" },
|
||||
{ "B134", "std.134" },
|
||||
@@ -660,15 +658,16 @@ struct portselect {
|
||||
{ "B4800", "std.4800" },
|
||||
{ "B9600", "std.9600" },
|
||||
{ "B19200", "std.19200" },
|
||||
{ 0 }
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
char *
|
||||
const char *
|
||||
portselector(void)
|
||||
{
|
||||
char c, baud[20], *type = "default";
|
||||
char c, baud[20];
|
||||
const char *type = "default";
|
||||
struct portselect *ps;
|
||||
int len;
|
||||
size_t len;
|
||||
|
||||
(void)alarm(5*60);
|
||||
for (len = 0; len < sizeof (baud) - 1; len++) {
|
||||
@@ -698,12 +697,13 @@ portselector(void)
|
||||
*/
|
||||
#include <sys/time.h>
|
||||
|
||||
char *
|
||||
const char *
|
||||
autobaud(void)
|
||||
{
|
||||
struct pollfd set[1];
|
||||
struct timespec timeout;
|
||||
char c, *type = "9600-baud";
|
||||
char c;
|
||||
const char *type = "9600-baud";
|
||||
|
||||
(void)tcflush(0, TCIOFLUSH);
|
||||
set[0].fd = STDIN_FILENO;
|
||||
|
||||
Reference in New Issue
Block a user