Re: XForms: launching X applications

Steve Lamont (spl@szechuan.ucsd.edu)
Fri, 5 Sep 97 06:53:15 PDT

To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> If this doesn't help, you can force it with the system() function,
> either:
>
> system("/usr/X11R6/bin/xv -display :0");
>
> or
>
> system("export DISPLAY=:0 ; /usr/X11R6/bin/xv");

The problem here is that this will block until you exit `xv', which is
not what the original poster wishes to do, I presume, since he's doing
a fork() and exec().

This also hard codes the DISPLAY environment variable to be the local
console which, in a network application, often is likely to be the
Wrong Thing.

I suspect that there's something bogus in the way that the exec() is
being done. There are several flavors of exec*(), If you're calling
execve(), for instance, there's an environment parameter which needs
to be looked after.

I vaguely recall seeing this problem with `xv' in some application
which fork()ed and exec()ed it -- perhaps it was the old NCSA Mosaic.
Every once and a while `xv' would refuse to start in a similar manner.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/