-----BEGIN PGP SIGNED MESSAGE-----
>
> > dctrl is too fast. It opens the communication pipe before the operating system
> > has managed to create it
> > ...
> > > catch {exec mkfifo -m 0666 $monfifo}
> > > after 2000
>
> It doesn't work for this RH user unfortunately, but I appreciate the prompt
> reply. More ideas anyone?
Take the patch to dctrl from the .4 patch. In the .4 patch there were some
modifications to dctrl that are missing from .5
- --- diald-0.16/bin/dctrl Tue Jan 28 00:21:42 1997
+++ diald-0.16.new/bin/dctrl Mon Mar 9 16:50:08 1998
@@ -9,6 +9,7 @@
set monfifo ""
set monfd ""
set fifofd ""
+set fifo_counter 0
# strip chart code
proc stripchart {win x y label} {
@@ -40,6 +41,7 @@
# get the new scale
set ns [expr "int($val)"]
if {$val > $ns} { incr ns }
+ if {"$ns" == "0"} { set ns 1}
set r [expr "($s+0.0)/$ns"]
$win scale all 0 $o 1 $r
set s $ns
@@ -51,6 +53,7 @@
set ns [expr "int($fs)"]
if {$fs > $ns} {incr ns}
if {$ns != $s} {
+ if {"$ns" == "0"} { set ns 1}
set r [expr "($s+0.0)/$ns"]
$win scale all 0 $o 1 $r
set s $ns
@@ -171,7 +174,7 @@
proc make_icon {} {
toplevel .dctrlIcon -class DctrlIcon -width 50 -height 50
- - canvas .dctrlIcon.canv -width 50 -height 32
+ canvas .dctrlIcon.canv -width 50 -height 33
.dctrlIcon.canv create text 2 2 \
-font -adobe-times-medium-r-*-*-12-*-*-*-*-*-*-* \
-text "Diald" -anchor nw
@@ -210,20 +213,34 @@
# MONITOR_QUEUE 0x0020
#
+proc killFifo {} {
+ global monfifo monfd
+ if {$monfd!=""} {close $monfd}
+ if {$monfifo!=""} {catch {exec rm -f $monfifo}}
+ set monfd ""
+ set monfifo ""
+}
+
proc openFifo {} {
- - global fifofd monfifo monfd default_FIFO
+ global fifofd monfifo monfd default_FIFO fifo_counter
# Turn off any previous monitoring
- - if {$monfd!=""} {close $monfd}
- - if {$monfifo!=""} {catch {exec rm -f $monfifo}}
+ killFifo
# get new monitoring fifo
set fifofd [open $default_FIFO w]
- - 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+]
fifoCmd "monitor $monfifo"
- - set monfd [open $monfifo r]
fileevent $monfd readable {stateChange}
}
@@ -264,7 +281,12 @@
proc stateChange {} {
global monfd status trans colors gload tload
- - set foo [gets $monfd]
+ set error [gets $monfd foo]
+ if ($error=="-1") {
+ # Make sure to clean up if the pipe goes south...
+ killFifo
+ return
+ }
if {$foo=="STATE"} {
set status(fsm) [gets $monfd]
if {$status(fsm)=="CONNECT"} {.message.vis.text delete 0.0 end}
@@ -335,8 +357,8 @@
proc dctrlQuit {} {
global fifofd monfifo fancy_icon
+ killFifo
if {$fifofd!=""} {
- - if {$monfifo!=""} {catch {exec rm -f $monfifo}}
catch {flush $fifofd}
}
if {"$fancy_icon" != 0} {
@@ -352,7 +374,7 @@
frame .menu -relief raised -bd 2
pack .menu -side top -fill x -expand 0
- -frame .spacer -width 480 -height 0
+frame .spacer -width 500 -height 0
pack .spacer -side top
menubutton .menu.file -text "File" -menu .menu.file.m -underline 0
@@ -600,4 +622,5 @@
load_init
update
+
openFifo
- --
Luca Olivetti | Tarifa Plana ya! http://tarifaplana.home.ml.org/
http://www.luca.ddns.org/ | FAQ http://www.luca.ddns.org/ptp-faq.html
- ----------------------------------------------------------------------------
Give a man a fish, and you feed him for a day.
Teach a man to fish, and he'll invite himself over for dinner.
- - Calvin Keegan
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: latin1
iQEVAwUBNfbNxy+cN8LMozC5AQHLWQf/QCbCq81f7/vpRU1ku+hgAM7TI59sifap
0/3gW/eoAAIzRQ3+pKWhq3WfVRC9vR4RGv+msEy9twJLHf5knanSexIeGmZAxCT+
2aj2322ydEo8FQzTFBNCo3+y/HF0nskoXqgcK/NlQJQ2usTfnFaAeQhSJ+F8Kf+E
47p9HB4SU1tTkpOChmu0uDosdF0DU5GQoKLAlEQi4u/Uon0R51bJ/nC3Rcl3z3mF
emjguF+wB1/de6oXbYmLhQuFRM4I7QkAkkb6+6mZdHl2nCHk3MmIg9IJMEaPOrSs
BRck4FIZWGvlgQszEuG9/OvIK2fDqrTezW+nmkjRcjodrJa8Z8lJtA==
=LcNN
-----END PGP SIGNATURE-----
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]