=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_launch.c,v retrieving revision 1.3 retrieving revision 1.6 diff -u -p -r1.3 -r1.6 --- OpenXM_contrib2/asir2000/io/ox_launch.c 2000/08/21 08:31:38 1.3 +++ OpenXM_contrib2/asir2000/io/ox_launch.c 2000/09/25 04:33:37 1.6 @@ -23,7 +23,7 @@ * shall be made on your publication or presentation in any form of the * results obtained by use of the SOFTWARE. * (4) In the event that you modify the SOFTWARE, you shall notify FLL by - * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification + * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification * for such modification or the source code of the modified part of the * SOFTWARE. * @@ -44,7 +44,7 @@ * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. - * $OpenXM: OpenXM_contrib2/asir2000/io/ox_launch.c,v 1.2 2000/02/08 04:47:11 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/io/ox_launch.c,v 1.5 2000/09/23 00:57:43 noro Exp $ */ #include #include @@ -312,6 +312,7 @@ char *dname; int pid; char wname[BUFSIZ]; char buf[BUFSIZ]; + char errcode; pid = fork(); if ( pid ) @@ -338,9 +339,9 @@ char *dname; close(i); #endif } - if ( strcmp(dname,"0") ) - execl(prog,prog,"-display",dname,0); - else { + if ( !strcmp(dname,"1" ) ) /* XXX: for ssh */ + execl(prog,prog,0); + else if ( !strcmp(dname,"0") ) { FILE *null; null = fopen("/dev/null","wb"); @@ -348,7 +349,12 @@ char *dname; dup2(fileno(null),2); putenv("DISPLAY="); execl(prog,prog,0); - } + } else + execl(prog,prog,"-display",dname,0); + /* On failure */ + errcode = 2; + write(4,&errcode,1); + exit(1); } #endif }