From 6dba9c937d5b6789136495e8f22bc795621b1a81 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 27 Jul 2015 01:24:23 +0200 Subject: improved error handling at switchctl 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; -- cgit v0.10.2