From cf1d197d50a62855db98526499c49cc8d92c19fc Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 7 Jan 2011 16:34:22 +0800 Subject: [PATCH] Fixed syntax error in snack handler --- src/server/handler_snack.c | 4 +--- src/server/main.c | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/server/handler_snack.c b/src/server/handler_snack.c index c1100cb..eab7e28 100644 --- a/src/server/handler_snack.c +++ b/src/server/handler_snack.c @@ -37,13 +37,11 @@ regex_t gSnack_ResponseRegex; // == CODE === int Snack_InitHandler() { - giSnack_SerialFD = open(gsSnack_SerialPort, O_RDWR | O_NOCTTY | O_NONBLOCK); + giSnack_SerialFD = InitSerial(gsSnack_SerialPort, 9600); if( giSnack_SerialFD == -1 ) { fprintf(stderr, "ERROR: Unable to open snack serial port ('%s')\n", gsSnack_SerialPort); } - InitSerial(giSnack_SerialFD, 9600); - regcomp(&gSnack_ResponseRegex, "^(\\d\\d\\d)(.*)$", REG_EXTENDED); return 0; } diff --git a/src/server/main.c b/src/server/main.c index b23cee4..8ffcd54 100644 --- a/src/server/main.c +++ b/src/server/main.c @@ -25,9 +25,9 @@ extern void Init_Handlers(void); extern void Load_Itemlist(void); extern void Server_Start(void); extern int giServer_Port; -extern char* gsItemListFile; -extern char* gsCoke_SerialPort; -extern char* gsSnack_SerialPort; +extern char *gsItemListFile; +extern char *gsCoke_SerialPort; +extern char *gsSnack_SerialPort; // === GLOBALS === int giDebugLevel = 0; -- 2.20.1