Line 0
Link Here
|
|
|
1 |
--- netadm/rpc.c 2008-01-27 16:29:09.000000000 +0100 |
2 |
+++ netadm/rpc.c 2008-01-27 16:34:49.000000000 +0100 |
3 |
@@ -35,7 +35,9 @@ |
4 |
|
5 |
#include <stdio.h> |
6 |
|
7 |
-#ifdef SYS_V |
8 |
+#ifdef __FreeBSD__ |
9 |
+#include <termios.h> |
10 |
+#elif defined(SYS_V) |
11 |
#include <termio.h> |
12 |
#else |
13 |
#ifndef _WIN32 |
14 |
@@ -749,7 +751,9 @@ |
15 |
{ |
16 |
|
17 |
#ifndef _WIN32 |
18 |
-#ifdef SYS_V |
19 |
+#ifdef __FreeBSD__ |
20 |
+ struct termios tio; |
21 |
+#elif defined(SYS_V) |
22 |
struct termio tio; |
23 |
#else |
24 |
struct sgttyb sg; |
25 |
@@ -762,7 +766,11 @@ |
26 |
|
27 |
fd = fileno(rfp); |
28 |
|
29 |
-#ifdef SYS_V |
30 |
+#ifdef __FreeBSD__ |
31 |
+ tcgetattr(fd, &tio); |
32 |
+ tio.c_lflag &= ~(ECHO); |
33 |
+ tcsetattr(fd, TCSANOW, &tio); |
34 |
+#elif defined(SYS_V) |
35 |
(void)ioctl(fd, (int)TCGETA, &tio); |
36 |
tio.c_lflag &= ~(ECHO); |
37 |
(void)ioctl(fd, (int)TCSETA, &tio); |
38 |
@@ -779,7 +787,9 @@ |
39 |
void devttyecho() /* turn echo on */ |
40 |
{ |
41 |
#ifndef _WIN32 |
42 |
-#ifdef SYS_V |
43 |
+#ifdef __FreeBSD__ |
44 |
+ struct termios tio; |
45 |
+#elif defined(SYS_V) |
46 |
struct termio tio; |
47 |
#else |
48 |
struct sgttyb sg; |
49 |
@@ -792,7 +802,11 @@ |
50 |
|
51 |
fd = fileno(rfp); |
52 |
|
53 |
-#ifdef SYS_V |
54 |
+#ifdef __FreeBSD__ |
55 |
+ tcgetattr(fd, &tio); |
56 |
+ tio.c_lflag |= ECHO; |
57 |
+ tcsetattr(fd, TCSANOW, &tio); |
58 |
+#elif defined(SYS_V) |
59 |
(void)ioctl(fd, (int)TCGETA, &tio); |
60 |
tio.c_lflag |= ECHO; |
61 |
(void)ioctl(fd, (int)TCSETA, &tio); |