From 3fefb5e63fc237b5575e42fa181dddc593f23870 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 23 Jan 2014 16:32:59 +0800 Subject: [PATCH] Server - Add error message if a bad baud rate is chosen --- src/server/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/main.c b/src/server/main.c index 6c2f691..247533e 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -231,7 +231,9 @@ int InitSerial(const char *File, int BaudRate) case 1200: baud = B1200; break; case 9600: baud = B9600; break; case 115200: baud = B115200; break; - default: close(fd); return -1; + default: + fprintf(stderr, "ERROR: Invalid baud rate to InitSerial (%i)\n", BaudRate); + exit(1); } info.c_lflag = 0; // Non-Canoical, No Echo -- 2.20.1