upas/fs: catch alarm note (used in pop3 code)

This commit is contained in:
cinap_lenrek 2012-08-30 17:39:22 +02:00
parent c430bf65d3
commit a7ed529d97
2 changed files with 5 additions and 6 deletions

View file

@ -145,10 +145,9 @@ usage(void)
} }
void void
notifyf(void *a, char *s) notifyf(void *, char *s)
{ {
USED(a); if(strstr(s, "alarm") || strstr(s, "interrupt"))
if(strncmp(s, "interrupt", 9) == 0)
noted(NCONT); noted(NCONT);
noted(NDFLT); noted(NDFLT);
} }

View file

@ -83,13 +83,13 @@ pop3resp(Pop *pop)
char *p; char *p;
alarm(60*1000); 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); close(pop->fd);
pop->fd = -1; pop->fd = -1;
alarm(0);
return "unexpected eof"; return "unexpected eof";
} }
alarm(0);
p = s+strlen(s)-1; p = s+strlen(s)-1;
while(p >= s && (*p == '\r' || *p == '\n')) while(p >= s && (*p == '\r' || *p == '\n'))