$NetBSD: patch-ad,v 1.4 2017/10/15 03:16:07 maya Exp $ --- source/io.c.orig 1994-07-22 01:47:26.000000000 +0000 +++ source/io.c @@ -90,12 +90,19 @@ typedef struct { int stuff; } fpvmach; #include #endif +#if (defined(BSD) && BSD >= 199306) /* XXX for all post 1993 BSDs? */ +#include +#endif + #ifdef USG #ifndef ATARI_ST #include #else #include "string.h" #endif +#if defined(__linux) +# include +#endif #if 0 /* Used to include termio.h here, but that caused problems on some systems, as curses.h includes it also above. */ @@ -245,7 +252,7 @@ int suspend() struct ltchars lcbuf; struct tchars cbuf; int lbuf; - long time(); + time_t time(); py.misc.male |= 2; (void) ioctl(0, TIOCGETP, (char *)&tbuf); @@ -313,7 +320,7 @@ void init_curses() #endif /* PC curses returns ERR */ -#if defined(USG) && !defined(PC_CURSES) && !defined(AMIGA) +#if 1 if (initscr() == NULL) #else if (initscr() == ERR) @@ -331,7 +338,7 @@ void init_curses() #if defined(atarist) && defined(__GNUC__) (void) signal (SIGTSTP, (__Sigfunc)suspend); #else -#ifdef __386BSD__ +#if defined(__386BSD__) || (defined(BSD) && BSD >= 199306) (void) signal (SIGTSTP, (sig_t)suspend); #else (void) signal (SIGTSTP, suspend); @@ -419,7 +426,7 @@ void moriaterm() init_color (3,1000, 500, 0); /* pen 3 - orange */ #else #if !defined(ATARI_ST) && !defined(VMS) -#ifdef USG +#if defined(USG) && defined(VINTR) (void) ioctl(0, TCGETA, (char *)&tbuf); /* disable all of the normal special control characters */ tbuf.c_cc[VINTR] = (char)3; /* control-C */ @@ -527,6 +534,7 @@ void restore_term() } #else { + int y, x; #ifdef AMIGA closetimer (); #endif @@ -542,7 +550,8 @@ void restore_term() pause_line(15); #endif /* this moves curses to bottom right corner */ - mvcur(stdscr->_cury, stdscr->_curx, LINES-1, 0); + getyx(stdscr, y, x); + mvcur(y, x, LINES-1, 0); endwin(); /* exit curses */ (void) fflush (stdout); #ifdef MSDOS @@ -757,7 +766,7 @@ void shell_out() msg_print("Fork failed. Try again."); return; } -#if defined(USG) || defined(__386BSD__) +#if defined(USG) || defined(__386BSD__) || (defined(BSD) && BSD >= 199306) (void) wait((int *) 0); #else (void) wait((union wait *) 0);