wait crashes X (or worse)



As a simple way to get my feet wet with gtk+-1.2, I have written a 
program to let me establish/disconnect my PPP connection.  I use
the code from testgtk to create a shaped icon of a telephone; when
it's clicked it fork/exec's the same shell script I've been using
for years to dial up the modem and establish a connection with
my ISP.  That part works.  The problem lies in the other half:
when I click on the uplifted phone icon, I want to 

	(a) change the icon back to the phone on hook; 
	(b) fork/exec another shell script to kill the PPP 
	    connection (again, the script is an old one that has 		    worked since 
forever); and
	(c) wait for everything to complete so as not to leave
	    zombie processes around.

I'm using the shape_create_icon code from testgtk.c to build my
icons - that part works just fine as long as I don't try to 
fork/exec anything; I seem to be able to fork/exec and wait as long
as the thing I'm forking/exec-ing doesn't persist, but in actual
practice, when I fork/exec the ppp process, I'm unable to hang
up by clicking on the icon without horrible things happening, 
including

	(a)  crashing the X-server (XFree86-3.3.2)
	(b)  locking up my system with an immovable X-cursor over
	     the icon, locked keyboard, forcing a power-cycle
	     reboot :-(

The problem seems to be in the wait code, but I've found nothing
in the gtk docs to tell me one way or the other what I'm doing 
wrong.  Surely this is something that y'all do every day.  

I've posted the code at http://www.tcsn.net/trefftzs/code/gtkppp.c

Any help, hints, or pointing out obvious idiocies will be 
greatly appreciated.

Thanks,

Jeff






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]