diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-02-18 03:32:53 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2001-02-18 03:32:53 +0000 |
commit | d53eadaf580866f1168125aeba82afae6ca37259 (patch) | |
tree | ebcbc96a4e642e612b98e70764810ad12b26f209 /games/backgammon | |
parent | f316b1c6d032ab614fe2cc886c5b286f3d80ea2d (diff) |
Get this not to segfault on startup on alpha.
Diffstat (limited to 'games/backgammon')
-rw-r--r-- | games/backgammon/backgammon/main.c | 14 | ||||
-rw-r--r-- | games/backgammon/common_source/back.h | 4 | ||||
-rw-r--r-- | games/backgammon/common_source/board.c | 6 | ||||
-rw-r--r-- | games/backgammon/common_source/init.c | 6 | ||||
-rw-r--r-- | games/backgammon/teachgammon/teach.c | 10 | ||||
-rw-r--r-- | games/backgammon/teachgammon/ttext2.c | 8 |
6 files changed, 23 insertions, 25 deletions
diff --git a/games/backgammon/backgammon/main.c b/games/backgammon/backgammon/main.c index 7e2b9c5fac6..8b9826dc1ba 100644 --- a/games/backgammon/backgammon/main.c +++ b/games/backgammon/backgammon/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.7 2001/01/04 20:37:54 todd Exp $ */ +/* $OpenBSD: main.c,v 1.8 2001/02/18 03:32:49 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: main.c,v 1.7 2001/01/04 20:37:54 todd Exp $"; +static char rcsid[] = "$OpenBSD: main.c,v 1.8 2001/02/18 03:32:49 pjanzen Exp $"; #endif #endif /* not lint */ @@ -55,7 +55,6 @@ static char rcsid[] = "$OpenBSD: main.c,v 1.7 2001/01/04 20:37:54 todd Exp $"; /* #define MAXUSERS 35 */ /* maximum number of users */ extern const char *const instr[]; /* text of instructions */ -speed_t ospeed; /* tty output speed */ const char *const helpm[] = { /* help message */ "Enter a space or newline to roll, or", @@ -118,9 +117,8 @@ main (argc,argv) errexit("backgammon(gtty)"); noech = old; noech.c_lflag &= ~ECHO; - raw = noech; - raw.c_lflag &= ~ICANON; /* set up modes */ - ospeed = cfgetospeed(&old); /* for termlib */ + traw = noech; + traw.c_lflag &= ~ICANON; /* set up modes */ /* check user count */ #if 0 @@ -144,10 +142,10 @@ main (argc,argv) args[acnt] = '\0'; if (tflag) { /* clear screen */ noech.c_oflag &= ~(ONLCR | OXTABS); - raw.c_oflag &= ~(ONLCR | OXTABS); + traw.c_oflag &= ~(ONLCR | OXTABS); clear(); } - fixtty(&raw); /* go into raw mode */ + fixtty(&traw); /* go into raw mode */ /* check if restored game and save flag for later */ if ((rfl = rflag)) { diff --git a/games/backgammon/common_source/back.h b/games/backgammon/common_source/back.h index 16a8f05435d..2c78d5b7fe9 100644 --- a/games/backgammon/common_source/back.h +++ b/games/backgammon/common_source/back.h @@ -1,4 +1,4 @@ -/* $OpenBSD: back.h,v 1.4 1999/07/31 21:57:40 pjanzen Exp $ */ +/* $OpenBSD: back.h,v 1.5 2001/02/18 03:32:52 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -130,7 +130,7 @@ extern const char *const *Colorptr; /* color of current player, * capitalized */ extern int colen; /* length of color of current player */ -extern struct termios old, noech, raw;/* original tty status */ +extern struct termios old, noech, traw;/* original tty status */ extern int curr; /* row position of cursor */ extern int curc; /* column position of cursor */ diff --git a/games/backgammon/common_source/board.c b/games/backgammon/common_source/board.c index f43f8e9d338..1c6dff60eec 100644 --- a/games/backgammon/common_source/board.c +++ b/games/backgammon/common_source/board.c @@ -1,4 +1,4 @@ -/* $OpenBSD: board.c,v 1.3 1999/07/31 21:57:40 pjanzen Exp $ */ +/* $OpenBSD: board.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: board.c,v 1.3 1999/07/31 21:57:40 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: board.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $"; #endif #endif /* not lint */ @@ -160,7 +160,7 @@ lastline: writec('\n'); writec('\n'); } - fixtty(&raw); + fixtty(&traw); } void diff --git a/games/backgammon/common_source/init.c b/games/backgammon/common_source/init.c index 60e386c78d2..7de84135f24 100644 --- a/games/backgammon/common_source/init.c +++ b/games/backgammon/common_source/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.3 1999/07/31 21:57:41 pjanzen Exp $ */ +/* $OpenBSD: init.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.3 1999/07/31 21:57:41 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $"; #endif #endif /* not lint */ @@ -107,4 +107,4 @@ int p[5]; int rscore; int table[6][6]; int wscore; -struct termios old, noech, raw; +struct termios old, noech, traw; diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index 62187dd19a5..dd6341443fa 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: teach.c,v 1.6 1999/07/31 21:57:41 pjanzen Exp $ */ +/* $OpenBSD: teach.c,v 1.7 2001/02/18 03:32:52 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: teach.c,v 1.6 1999/07/31 21:57:41 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: teach.c,v 1.7 2001/02/18 03:32:52 pjanzen Exp $"; #endif #endif /* not lint */ @@ -81,14 +81,14 @@ main(argc, argv) errexit("teachgammon(gtty)"); noech = old; noech.c_lflag &= ~ECHO; - raw = noech; - raw.c_lflag &= ~ICANON; /* set up modes */ + traw = noech; + traw.c_lflag &= ~ICANON; /* set up modes */ ospeed = cfgetospeed(&old); /* for termlib */ tflag = getcaps(getenv("TERM")); getarg(argc, argv); if (tflag) { noech.c_oflag &= ~(ONLCR | OXTABS); - raw.c_oflag &= ~(ONLCR | OXTABS); + traw.c_oflag &= ~(ONLCR | OXTABS); clear(); } text(hello); diff --git a/games/backgammon/teachgammon/ttext2.c b/games/backgammon/teachgammon/ttext2.c index 952ed0d1620..40769d0fc30 100644 --- a/games/backgammon/teachgammon/ttext2.c +++ b/games/backgammon/teachgammon/ttext2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ttext2.c,v 1.3 1999/07/31 21:57:41 pjanzen Exp $ */ +/* $OpenBSD: ttext2.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $ */ /* * Copyright (c) 1980, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)ttext2.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: ttext2.c,v 1.3 1999/07/31 21:57:41 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: ttext2.c,v 1.4 2001/02/18 03:32:52 pjanzen Exp $"; #endif #endif /* not lint */ @@ -145,7 +145,7 @@ text(txt) writel(a); writec('\n'); } else { - fixtty(&raw); + fixtty(&traw); writel(prompt); /* if begscr is set we're past the rules screens */ if (!begscr) { @@ -192,6 +192,6 @@ text(txt) begin = txt; } } - fixtty(&raw); + fixtty(&traw); return(0); } |