[LEDE-DEV] [PATCH ugps 3/7] Bail out if we can't find GPS device

Petr Štetiar ynezz at true.cz
Wed Jul 27 05:45:50 PDT 2016


Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main.c b/main.c
index 87d069b..6ff4c17 100644
--- a/main.c
+++ b/main.c
@@ -145,7 +145,10 @@ main(int argc, char ** argv)
 	conn.path = ubus_socket;
 	conn.cb = ubus_connect_handler;
 	ubus_auto_connect(&conn);
-	nmea_open(argv[1], &stream, B4800);
+
+	if (nmea_open(device, &stream, B4800) < 0)
+		return -1;
+
 	uloop_run();
 	uloop_done();
 
-- 
1.9.1




More information about the Lede-dev mailing list