diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-02-09 02:11:24 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-02-09 02:11:24 +0000 |
commit | 31ca54aa86a90052f8fe73fda66c7f39fd5079bc (patch) | |
tree | 91bf4097b9145323fd2aee645a2a42348e33b22e /cli.c | |
parent | e9cf357a99dcd2db14635974289e04f5f0808123 (diff) |
- itojun@cvs.openbsd.org 2001/02/08 19:30:52
sync with netbsd tree changes.
- more strict prototypes, include necessary headers
- use paths.h/pathnames.h decls
- size_t typecase to int -> u_long
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1,8 +1,9 @@ | |||
1 | #include "includes.h" | 1 | #include "includes.h" |
2 | RCSID("$OpenBSD: cli.c,v 1.7 2001/02/04 15:32:23 stevesk Exp $"); | 2 | RCSID("$OpenBSD: cli.c,v 1.8 2001/02/08 19:30:51 itojun Exp $"); |
3 | 3 | ||
4 | #include "xmalloc.h" | 4 | #include "xmalloc.h" |
5 | #include "log.h" | 5 | #include "log.h" |
6 | #include "cli.h" | ||
6 | 7 | ||
7 | static int cli_input = -1; | 8 | static int cli_input = -1; |
8 | static int cli_output = -1; | 9 | static int cli_output = -1; |
@@ -31,7 +32,7 @@ cli_open(int from_stdin) | |||
31 | cli_input = STDIN_FILENO; | 32 | cli_input = STDIN_FILENO; |
32 | cli_output = STDERR_FILENO; | 33 | cli_output = STDERR_FILENO; |
33 | } else { | 34 | } else { |
34 | cli_input = cli_output = open("/dev/tty", O_RDWR); | 35 | cli_input = cli_output = open(_PATH_TTY, O_RDWR); |
35 | if (cli_input < 0) | 36 | if (cli_input < 0) |
36 | fatal("You have no controlling tty. Cannot read passphrase."); | 37 | fatal("You have no controlling tty. Cannot read passphrase."); |
37 | } | 38 | } |
@@ -42,7 +43,7 @@ cli_open(int from_stdin) | |||
42 | } | 43 | } |
43 | 44 | ||
44 | static void | 45 | static void |
45 | cli_close() | 46 | cli_close(void) |
46 | { | 47 | { |
47 | if (!cli_from_stdin && cli_input >= 0) | 48 | if (!cli_from_stdin && cli_input >= 0) |
48 | close(cli_input); | 49 | close(cli_input); |
@@ -53,13 +54,13 @@ cli_close() | |||
53 | } | 54 | } |
54 | 55 | ||
55 | void | 56 | void |
56 | intrcatch() | 57 | intrcatch(int sig) |
57 | { | 58 | { |
58 | intr = 1; | 59 | intr = 1; |
59 | } | 60 | } |
60 | 61 | ||
61 | static void | 62 | static void |
62 | cli_echo_disable() | 63 | cli_echo_disable(void) |
63 | { | 64 | { |
64 | sigemptyset(&nset); | 65 | sigemptyset(&nset); |
65 | sigaddset(&nset, SIGTSTP); | 66 | sigaddset(&nset, SIGTSTP); |
@@ -82,7 +83,7 @@ cli_echo_disable() | |||
82 | } | 83 | } |
83 | 84 | ||
84 | static void | 85 | static void |
85 | cli_echo_restore() | 86 | cli_echo_restore(void) |
86 | { | 87 | { |
87 | if (echo_modified != 0) { | 88 | if (echo_modified != 0) { |
88 | tcsetattr(cli_input, TCSANOW, &otio); | 89 | tcsetattr(cli_input, TCSANOW, &otio); |