SCCS-vsn: bin/stty/stty.c 5.19
- * Copyright (c) 1980, 1989 Regents of the University of California.
+ * Copyright (c) 1980, 1989, 1991 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
char copyright[] =
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#ifndef lint
char copyright[] =
-"@(#) Copyright (c) 1980, 1989 Regents of the University of California.\n\
+"@(#) Copyright (c) 1980, 1989, 1991 Regents of the University of California.\n\
All rights reserved.\n";
#endif not lint
#ifndef lint
All rights reserved.\n";
#endif not lint
#ifndef lint
-static char sccsid[] = "@(#)stty.c 5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)stty.c 5.19 (Berkeley) %G%";
struct winsize win;
int ldisc;
struct winsize win;
int ldisc;
int debug = 0;
int trace, dotrace;
int extproc;
int debug = 0;
int trace, dotrace;
int extproc;
prmode(&t, ldisc, ALL);
exit(0);
}
prmode(&t, ldisc, ALL);
exit(0);
}
- if (eq("old", *argv)) {
- goto next;
- }
- if (eq("new", *argv)) {
+ if (eq("tty", *argv) || eq("old", *argv) || eq("new", *argv)) {
+ int nldisc = TTYDISC;
+
+ if (ioctl(0, TIOCSETD, &nldisc) < 0)
+ syserrexit("TIOCSETD");
goto next;
}
if (eq("nl", *argv)) {
goto next;
}
if (eq("nl", *argv)) {
default:
sprintf(unknown, "#%d", ldisc);
ld = unknown;
default:
sprintf(unknown, "#%d", ldisc);
ld = unknown;
}
put("%s disc; ", ld);
}
}
put("%s disc; ", ld);
}