summaryrefslogtreecommitdiff
path: root/comms/xtel/patches/patch-ae
blob: a65a240cbfe425237176a7d87e2259efdccc02fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$NetBSD: patch-ae,v 1.2 2006/01/02 16:17:09 joerg Exp $

--- mdmdetect.c.orig	2001-02-11 00:02:58.000000000 +0000
+++ mdmdetect.c
@@ -37,18 +37,20 @@ static char rcsid[] = "$Id: mdmdetect.c,
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#ifdef USE_TERMIOS
+#include <termios.h>
+#else
 #include <termio.h>
+#endif
 #ifdef SVR4
 #include <sys/mkdev.h>
 #endif /* SVR4 */
 
 #define TIMEOUT_READ		5
 
-#ifndef __FreeBSD__
-#ifndef __GLIBC__
+#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__DragonFly__) && !defined(__GLIBC__)
 extern char *sys_errlist[];
 #endif
-#endif
 extern char *xtel_basename (), *next_token ();
 
 static int fdl;
@@ -290,7 +292,11 @@ char **av;
     check_and_lock (cp);
 
     sprintf (buf, "/dev/%s", cp);
+#ifdef __NetBSD
+    if ((fd = open (buf, O_RDWR)) < 0) {
+#else
     if ((fd = open (buf, O_RDWR|O_NDELAY)) < 0) {
+#endif
       perror (buf);
       exit (1);
     }