diff options
author | Christian Pointner <equinox@helsinki.at> | 2015-07-26 23:24:23 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2015-07-26 23:24:23 (GMT) |
commit | 6dba9c937d5b6789136495e8f22bc795621b1a81 (patch) | |
tree | 0c2ef4f6fe07213170e942208b07fff40552bf7f | |
parent | 7fd5f19cdde5e55775207ae95487b810785d1388 (diff) |
improved error handling at switchctl
-rw-r--r-- | src/switchctl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/switchctl.c b/src/switchctl.c index 1015185..a06912a 100644 --- a/src/switchctl.c +++ b/src/switchctl.c @@ -1120,9 +1120,10 @@ int main(int argc, char* argv[]) int switch_fd = 0; for(;;) { switch_fd = open(opt.switch_dev_, O_RDWR | O_NOCTTY); - if(switch_fd < 0) + if(switch_fd < 0) { + log_printf(ERROR, "open(%s): %s", opt.switch_dev_, strerror(errno)); ret = 2; - else { + } else { ret = setup_tty(switch_fd, opt.baudrate_); if(ret) ret = 2; |