On Sun, 4 Oct 1998, Peter J. MASON wrote:
>
> > I don't remember the details but there was something more in the patch.
>
> I do. Here's Luca's patch ....
>
>
> - - set monfifo /tmp/dctrl.[pid]
> + #
> + set fifo_counter [expr "$fifo_counter+1"]
> + set monfifo /tmp/dctrl.[pid]-$fifo_counter
> + # If an event comes along that causes a signal, then
> + # it is possible the exec above gets exited BEFORE
> + # it finishes waiting. Nasty stuff.
> + # so, we do a little loop until we can confirm the fifo exists
> + # before we ask diald to deal with it.
> catch {exec mkfifo -m 0600 $monfifo}
> + set monfd [open $monfifo r+]
The option "r+" is magic here! It will open the fifo for both reading and
writing. Opening a fifo for reading will normally suspend until a writer
opens the fifo for writing. Opening a fifo for writing will fail unless
the fifo is opened for reading or a reader is suspended trying to open the
fifo for reading. Opening the fifo for both reading and writing at the
same time will not block because the write end will be opened, and the
write part will succeed because the read end is being opened.
> fifoCmd "monitor $monfifo"
> - - set monfd [open $monfifo r]
> fileevent $monfd readable {stateChange}
> }
>
> - --
>
> --
> Peter J. MASON
> email: [EMAIL PROTECTED]
> home: http://www.fl.net.au/~petem
>
--
Villy
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]