From: Petr Štetiar Date: Wed, 27 Jul 2016 12:45:53 +0000 (+0200) Subject: Show more useful error message if we can't open GPS device X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fugps.git;a=commitdiff_plain;h=0475fa677a3cda7c420351748925cb5149f73376 Show more useful error message if we can't open GPS device Signed-off-by: Petr Štetiar --- diff --git a/nmea.c b/nmea.c index 5a691b9..4d9cb90 100644 --- a/nmea.c +++ b/nmea.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -314,7 +315,7 @@ nmea_open(char *dev, struct ustream_fd *s, speed_t speed) tty = open(dev, O_RDWR | O_NOCTTY | O_NONBLOCK); if (tty < 0) { - ERROR("%s: device open failed\n", dev); + ERROR("%s: device open failed: %s\n", dev, strerror(errno)); return -1; }