diff options
author | Fritz Elfert <felfert@to.com> | 2001-07-31 18:33:17 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2001-07-31 18:33:17 +0000 |
commit | 516fdb01452002400ce93911702b9737854d7470 (patch) | |
tree | 535f06f5cac09d16eaf9a0942046053a08b5a21c /ncpd | |
parent | afef8917d01e904d564dc0a80439225d4f0546c1 (diff) | |
download | plptools-516fdb01452002400ce93911702b9737854d7470.tar.gz plptools-516fdb01452002400ce93911702b9737854d7470.tar.bz2 plptools-516fdb01452002400ce93911702b9737854d7470.zip |
FreeBSD
Diffstat (limited to 'ncpd')
-rw-r--r-- | ncpd/mp_serial.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ncpd/mp_serial.c b/ncpd/mp_serial.c index 05a014c..cf6ff68 100644 --- a/ncpd/mp_serial.c +++ b/ncpd/mp_serial.c @@ -30,7 +30,8 @@ #include <unistd.h> /* for usleep() */ #include <string.h> /* for bzero() */ #include <termios.h> -#if defined(linux) || defined(_IBMR2) || defined(__NetBSD__) +#if defined(linux) || defined(_IBMR2) || \ + defined(__NetBSD__) || defined(__FreeBSD__) #include <sys/ioctl.h> /* for ioctl() */ #endif #include <sys/errno.h> @@ -151,7 +152,8 @@ init_serial(const char *dev, int speed, int debug) #if defined(hpux) || defined(_IBMR2) ti.c_cflag = CS8 | HUPCL | clocal | CREAD; #endif -#if defined(sun) || defined(linux) || defined(__sgi) || defined(__NetBSD__) +#if defined(sun) || defined(linux) || defined(__sgi) || \ + defined(__NetBSD__) || defined(__FreeBSD__) ti.c_cflag = CS8 | HUPCL | clocal | CRTSCTS | CREAD; ti.c_iflag = IGNBRK | IGNPAR | IXON | IXOFF; ti.c_cc[VMIN] = 1; @@ -182,10 +184,11 @@ void ser_exit(int fd) { struct termios ti; - if (ioctl(fd, TCGETS, (caddr_t) & ti) < 0) - perror("TCGETSW"); + + if (tcgetattr(fd, &ti) < 0) + perror("tcgetattr"); ti.c_cflag &= ~CRTSCTS; if (tcsetattr(fd, TCSANOW, &ti) < 0) - perror("TCSETSW"); + perror("tcsetattr"); (void) close(fd); } |