summaryrefslogtreecommitdiff
path: root/unixio.c
diff options
context:
space:
mode:
Diffstat (limited to 'unixio.c')
-rw-r--r--unixio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/unixio.c b/unixio.c
index 6a7e0f0..5dd7843 100644
--- a/unixio.c
+++ b/unixio.c
@@ -39,6 +39,8 @@
and strip it from inbound characters.
*/
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <time.h>
#include <errno.h>
@@ -143,8 +145,8 @@ int
pktmode(short on) {
if (ttyfd < 0) /* Device must be open */
return(0);
- system(on ? "stty raw -echo" : "stty sane"); /* Crude but effective */
- return(1);
+ return (system(on ? "stty raw -echo" : "stty sane") /* Crude but effective */
+ ? 0 : 1);
}