Fix errno usage and add DragonFly support
Signed-off-by: Masanori Ogino <mogino@acm.org>
This commit is contained in:
parent
89151996c6
commit
0a67b18647
10 changed files with 18 additions and 31 deletions
15
sj3/sj3.c
15
sj3/sj3.c
|
|
@ -38,14 +38,12 @@
|
|||
#include "sj_sysvdef.h"
|
||||
#include "wchar16.h"
|
||||
#include <signal.h>
|
||||
#include <sys/errno.h>
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#if defined(__NetBSD__) || defined(__bsdi__)
|
||||
#include <errno.h>
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||
#define USE_OLD_TTY
|
||||
#if defined(__NetBSD__)
|
||||
#define LACKOF_SETLOCALE
|
||||
#endif
|
||||
#endif
|
||||
#include <curses.h>
|
||||
#endif
|
||||
|
||||
|
|
@ -473,7 +471,7 @@ getmaster ()
|
|||
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||
*/
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
struct stat stb;
|
||||
int h, i, j, k1, k2;
|
||||
#else /* !__FreeBSD__ */
|
||||
|
|
@ -492,7 +490,7 @@ getmaster ()
|
|||
* Because FreeBSD's master pseudo-devices are pty[p-sP-S][0-9a-v].
|
||||
* Patched by Hidekazu Kuroki(hidekazu@cs.titech.ac.jp) 1996/8/10
|
||||
*/
|
||||
#if defined(__FreeBSD__)
|
||||
#if defined(__FreeBSD__) || defined(__DragonFly__)
|
||||
for (h = 0; h < 8; h++) {
|
||||
line[k1] = "pqrsPQRS"[h];
|
||||
line[k2] = '0';
|
||||
|
|
@ -852,7 +850,7 @@ shellprocess ()
|
|||
SCPYN(Utmp.ut_line, strrchr (slave_name, '/') + 1);
|
||||
time (&Utmp.ut_time);
|
||||
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||
if (setsid() < 0)
|
||||
perror("setsid()");
|
||||
#else
|
||||
|
|
@ -937,7 +935,7 @@ getslave ()
|
|||
done2 ();
|
||||
}
|
||||
#ifndef SYSV_TERMIOS
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__)
|
||||
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
|
||||
ioctl(slave, TIOCSCTTY, NULL);
|
||||
#endif
|
||||
ioctl (slave, TIOCSETP, (char *)&b);
|
||||
|
|
@ -1085,7 +1083,6 @@ suspend ()
|
|||
SELECT_FD ifds;
|
||||
int nc;
|
||||
struct timeval t;
|
||||
extern int errno;
|
||||
|
||||
clear_guide_line ();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue