ossp-pkg/sio/sio.c 1.9 -> 1.10
--- sio.c 2002/11/08 10:34:24 1.9
+++ sio.c 2002/11/08 19:46:42 1.10
@@ -207,8 +207,8 @@
sios->writer.func = sios->module->output;
sios->writer.stage = sios;
- sios->reader.cross = &sios->writer;
- sios->writer.cross = &sios->reader;
+ sios->reader.cross = NULL;
+ sios->writer.cross = NULL;
sios->reader.tag = "reader";
sios->writer.tag = "writer";
@@ -353,6 +353,11 @@
ADDTAIL(&sio->writers,hd,&sios->writer);
}
+ if (rw == SIO_MODE_READWRITE) {
+ sios->reader.cross = &sios->writer;
+ sios->writer.cross = &sios->reader;
+ }
+
sios->reader.al = sio->readers.al;
sios->writer.al = sio->writers.al;
sios->rw = rw;
@@ -391,6 +396,11 @@
sios->module->closer(sio, sio->readers.al, sios->userdata);
}
+ if (sios->rw == SIO_MODE_READWRITE) {
+ sios->reader.cross = NULL;
+ sios->writer.cross = NULL;
+ }
+
sios->writer.al = NULL;
sios->reader.al = NULL;
|
|