summaryrefslogtreecommitdiff
path: root/unixio.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2016-06-16 16:05:32 -0400
committerPaul Selkirk <paul@psgd.org>2016-06-16 20:53:05 -0400
commit7733c95be8a9e93ae4398c13c721b334239780fe (patch)
tree23167248232e093961cc1ef152a0b65e476ed688 /unixio.c
parent04d48e513f2094345eb697c0a34345daff63a87b (diff)
Initial cleanup
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);
}