From: John Hodge Date: Fri, 7 Jan 2011 08:34:22 +0000 (+0800) Subject: Fixed syntax error in snack handler X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=cf1d197d50a62855db98526499c49cc8d92c19fc;p=tpg%2Fopendispense2.git Fixed syntax error in snack handler --- 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;