aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/comcontrol/comcontrol.c8
-rw-r--r--sbin/i386/comcontrol/comcontrol.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/sbin/comcontrol/comcontrol.c b/sbin/comcontrol/comcontrol.c
index 194554a63c52..e88e3d8f71e0 100644
--- a/sbin/comcontrol/comcontrol.c
+++ b/sbin/comcontrol/comcontrol.c
@@ -58,12 +58,10 @@ int main(int argc, char *argv[])
}
if (argc == 2) {
- if (ioctl(fd, TIOCMGBIDIR, &res) < 0) {
- perror("TIOCMGBIDIR");
- exit(1);
+ if (ioctl(fd, TIOCMGBIDIR, &res) >= 0) {
+ if (!res) printf("-");
+ printf("bidir ");
}
- if (!res) printf("-");
- printf("bidir ");
if (ioctl(fd, TIOCMGDTRWAIT, &dtrwait) < 0) {
perror("TIOCMGDTRWAIT");
exit(1);
diff --git a/sbin/i386/comcontrol/comcontrol.c b/sbin/i386/comcontrol/comcontrol.c
index 194554a63c52..e88e3d8f71e0 100644
--- a/sbin/i386/comcontrol/comcontrol.c
+++ b/sbin/i386/comcontrol/comcontrol.c
@@ -58,12 +58,10 @@ int main(int argc, char *argv[])
}
if (argc == 2) {
- if (ioctl(fd, TIOCMGBIDIR, &res) < 0) {
- perror("TIOCMGBIDIR");
- exit(1);
+ if (ioctl(fd, TIOCMGBIDIR, &res) >= 0) {
+ if (!res) printf("-");
+ printf("bidir ");
}
- if (!res) printf("-");
- printf("bidir ");
if (ioctl(fd, TIOCMGDTRWAIT, &dtrwait) < 0) {
perror("TIOCMGDTRWAIT");
exit(1);