Shutdown prpoerly

This commit is contained in:
dcp1990 2005-06-18 23:23:44 +00:00
parent dd107285cf
commit b27026d0cb
3 changed files with 4 additions and 1 deletions

View file

@ -24,6 +24,7 @@ void yyerror(str)
{ {
lprintf(fatal, "parser: error: %s at line %d chr %d (near %s)\n", str, lprintf(fatal, "parser: error: %s at line %d chr %d (near %s)\n", str,
lincnt, chrcnt, yytext); lincnt, chrcnt, yytext);
shutd();
exit(-1); exit(-1);
} }
int yywrap(void) int yywrap(void)

View file

@ -55,6 +55,8 @@ void initialize(void)
pthread_mutex_lock(&cfmx); pthread_mutex_lock(&cfmx);
if(init_modem(cf.modemdev) != 1) { if(init_modem(cf.modemdev) != 1) {
lprintf(warn, "warning: modem didn't initialise properly; see previous messages\n"); lprintf(warn, "warning: modem didn't initialise properly; see previous messages\n");
shutd();
exit(-1);
} }
pthread_mutex_unlock(&cfmx); pthread_mutex_unlock(&cfmx);
} }

View file

@ -187,7 +187,7 @@ void *modem_io(k)
/* struct timeval tv; /* struct timeval tv;
short dotm = 0; */ short dotm = 0; */
char cbuf[2]; char cbuf[2];
if(k == 0) ; if(k == 0) k = 0;
*cbuf = '\0'; cbuf[1] = '\0'; *cbuf = '\0'; cbuf[1] = '\0';
pthread_mutex_lock(&modemmx); pthread_mutex_lock(&modemmx);
pthread_mutex_lock(&miomx); pthread_mutex_lock(&miomx);