factotum: fix flush handling for /mnt/factotum/needkey use

This commit is contained in:
cinap_lenrek 2011-09-27 11:44:21 +02:00
parent bb3a16f07f
commit b8d741d34b
2 changed files with 9 additions and 5 deletions

View file

@ -21,8 +21,9 @@ confirmflush(Req *r)
*l = r->aux;
if(r->aux == nil)
cuselast = l;
closereq(r);
break;
r->aux = nil;
respond(r, "interrupted");
return;
}
}
logbufflush(&confbuf, r);
@ -81,6 +82,7 @@ confirmwrite(char *s)
*l = r->aux;
if(r->aux == nil)
cuselast = l;
r->aux = nil;
break;
}
}
@ -143,8 +145,9 @@ needkeyflush(Req *r)
*l = r->aux;
if(r->aux == nil)
needlast = l;
closereq(r);
break;
r->aux = nil;
respond(r, "interrupted");
return;
}
}
logbufflush(&needkeybuf, r);
@ -175,6 +178,7 @@ needkeywrite(char *s)
*l = r->aux;
if(r->aux == nil)
needlast = l;
r->aux = nil;
break;
}
}

View file

@ -59,9 +59,9 @@ logbufflush(Logbuf *lb, Req *r)
for(l=&lb->wait; *l; l=&(*l)->aux){
if(*l == r){
*l = r->aux;
r->aux = nil;
if(*l == nil)
lb->waitlast = l;
r->aux = nil;
respond(r, "interrupted");
break;
}