From: John Hodge Date: Thu, 23 Jan 2014 08:32:59 +0000 (+0800) Subject: Server - Add error message if a bad baud rate is chosen X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3fefb5e63fc237b5575e42fa181dddc593f23870;p=tpg%2Fopendispense2.git Server - Add error message if a bad baud rate is chosen --- 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