upas/fs: catch alarm note (used in pop3 code)
This commit is contained in:
parent
c430bf65d3
commit
a7ed529d97
2 changed files with 5 additions and 6 deletions
|
@ -145,10 +145,9 @@ usage(void)
|
|||
}
|
||||
|
||||
void
|
||||
notifyf(void *a, char *s)
|
||||
notifyf(void *, char *s)
|
||||
{
|
||||
USED(a);
|
||||
if(strncmp(s, "interrupt", 9) == 0)
|
||||
if(strstr(s, "alarm") || strstr(s, "interrupt"))
|
||||
noted(NCONT);
|
||||
noted(NDFLT);
|
||||
}
|
||||
|
|
|
@ -83,13 +83,13 @@ pop3resp(Pop *pop)
|
|||
char *p;
|
||||
|
||||
alarm(60*1000);
|
||||
if((s = Brdstr(&pop->bin, '\n', 0)) == nil){
|
||||
s = Brdstr(&pop->bin, '\n', 0);
|
||||
alarm(0);
|
||||
if(s == nil){
|
||||
close(pop->fd);
|
||||
pop->fd = -1;
|
||||
alarm(0);
|
||||
return "unexpected eof";
|
||||
}
|
||||
alarm(0);
|
||||
|
||||
p = s+strlen(s)-1;
|
||||
while(p >= s && (*p == '\r' || *p == '\n'))
|
||||
|
|
Loading…
Reference in a new issue