=================================================================== RCS file: /home/cvs/OpenXM_contrib2/fep/fep_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -p -r1.2 -r1.3 --- OpenXM_contrib2/fep/fep_main.c 2002/09/09 12:11:51 1.2 +++ OpenXM_contrib2/fep/fep_main.c 2002/09/18 10:03:28 1.3 @@ -2,7 +2,7 @@ #ifndef lint static char rcsid[]= -"$Id: fep_main.c,v 1.2 2002/09/09 12:11:51 noro Exp $ (SRA)"; +"$Id: fep_main.c,v 1.3 2002/09/18 10:03:28 noro Exp $ (SRA)"; #endif /* lint */ #include @@ -10,6 +10,10 @@ static char rcsid[]= #include #include #include +#if defined(sun) +#include +#include +#endif #ifdef TERMIOS #include #if defined(__linux__) || defined(__CYGWIN__) @@ -57,7 +61,11 @@ int histlen = -1; /* history length */ int debug = OFF; /* debug switch */ int auto_tty_fix = ON; /* fix tty mode automaticaly */ FILE *script_fp = NULL; /* script file pointer */ +#if defined(sun) +void catchsig (int); /* function take care SIGCHILD */ +#else void catchsig __P((int)); /* function take care SIGCHILD */ +#endif #ifdef TERMIOS #define ttystruct termios @@ -72,7 +80,11 @@ int lines; /* terminal line size */ int columns; /* terminal coulumn size */ char *term_clear; /* terminal clear code */ +#if defined(sun) +void (*sighup)(int), (*sigchld)(int), (*sigtstp)(int); +#else void (*sighup) __P((int)), (*sigchld) __P((int)), (*sigtstp) __P((int)); +#endif /* function buffer for signal */ #ifdef TIOCSETN @@ -296,8 +308,12 @@ DEFAULT: fix_signal () { #ifdef SIGWINCH +#if defined(sun) + void sigwinch (int); +#else void sigwinch __P((int)); #endif +#endif sighup = signal (SIGHUP, terminate); sigchld = signal (SIGCHLD, catchsig); @@ -965,7 +981,11 @@ recover_tty() suspend() { long pid; +#if defined(sun) + void (*func) (int); +#else void (*func) __P((int)); +#endif #ifndef __CYGWIN32__ int omask; #endif @@ -977,7 +997,7 @@ suspend() signal (SIGTSTP, SIG_DFL); recover_tty(); #define mask(s) (1 << ((s)-1)) -#ifndef __CYGWIN32__ +#if !defined(__CYGWIN32__) && !defined(sun) omask = sigsetmask (sigblock (0) & ~mask (SIGTSTP)); #endif kill (0, SIGTSTP); @@ -990,7 +1010,7 @@ suspend() kill (0, SIGCONT); signal (SIGCHLD, func); signal (SIGTSTP, SIG_IGN); -#ifndef __CYGWIN32__ +#if !defined(__CYGWIN32__) && !defined(sun) sigblock (mask (SIGTSTP)); #endif fix_tty ();