=================================================================== RCS file: /home/cvs/OpenXM/rc/repl.c,v retrieving revision 1.11 retrieving revision 1.13 diff -u -p -r1.11 -r1.13 --- OpenXM/rc/repl.c 2003/01/17 00:41:05 1.11 +++ OpenXM/rc/repl.c 2003/01/17 01:01:04 1.13 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/rc/repl.c,v 1.10 2003/01/16 08:27:23 maekawa Exp $ */ +/* $OpenXM: OpenXM/rc/repl.c,v 1.12 2003/01/17 00:53:09 maekawa Exp $ */ #include #include @@ -10,6 +10,7 @@ #define BUFSIZE 10000 +#define REPL_IMGFILE "/tmp/repl_test.img" #define REPL_PSFILE "/tmp/repl_test.ps" int @@ -60,15 +61,19 @@ main(int argc,char *argv[]) { fprintf(fp,"/Times-Roman findfont 10 scalefont setfont\n"); fprintf(fp," 390 290 moveto (F) show \n"); fprintf(fp,"showpage \n"); - fclose(fp); + while (fclose(fp) != 0) { + if (errno == EINTR) + continue; + break; + } - if (!system("pstoimg -type png /tmp/repl_test.ps -out /tmp/repl_test.png >/dev/null")) { + if (!system("pstoimg -type png /tmp/repl_test.ps -out /tmp/repl_test.img >/dev/null")) { if (type == 'b') { printf("export OpenXM_PSTOIMG_TYPE=png\n"); }else{ printf("setenv OpenXM_PSTOIMG_TYPE png\n"); } - }else if (!system("pstoimg -type gif /tmp/repl_test.ps -out /tmp/repl_test.gif >/dev/null")) { + }else if (!system("pstoimg -type gif /tmp/repl_test.ps -out /tmp/repl_test.img >/dev/null")) { if (type == 'b') { printf("OpenXM_PSTOIMG_TYPE=gif\n"); printf("export OpenXM_PSTOIMG_TYPE\n"); @@ -79,8 +84,17 @@ main(int argc,char *argv[]) { printf("OpenXM_PSTOIMG_TYPE=no\n"); printf("export OpenXM_PSTOIMG_TYPE\n"); } - system("rm -f /tmp/repl_test.*"); + while (unlink(REPL_IMGFILE) != 0) { + if (errno == EINTR) + continue; + break; + } + while (unlink(REPL_PSFILE) != 0) { + if (errno == EINTR) + continue; + break; + } exit(EXIT_SUCCESS); }