changeset: 1970:c8046bd05e65
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Tue Feb 27 03:14:39 2007 -0500
summary: Fix an infinate loop with multiple reads on the same /event fid.
diff -r 101e7939736d -r c8046bd05e65 fs.c
--- a/fs.c Tue Feb 27 01:57:01 2007 -0500
+++ b/fs.c Tue Feb 27 03:14:39 2007 -0500
@@ -314,7 +314,7 @@ write_event(char *format, ...) {
va_list ap;
FidLink *f;
FileId *fi;
- P9Req *aux;
+ P9Req *aux, *req;
va_start(ap, format);
vsnprintf(buffer, BUFFER_SIZE, format, ap);
@@ -328,8 +328,10 @@ write_event(char *format, ...) {
(fi->content.buf)[slen] = '\0';
strcat(fi->content.buf, buffer);
}
- while((aux = pending_event_reads)) {
- pending_event_reads = pending_event_reads->aux;
+ req = pending_event_reads;
+ pending_event_reads = nil;
+ while((aux = req)) {
+ req = req->aux;
respond_event(aux);
}
}
Received on Tue Feb 27 2007 - 09:18:51 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:59 UTC