$OpenBSD: patch-texk_dviljk_dvi2xx_c,v 1.1 2003/02/18 16:04:50 sturm Exp $
--- texk/dviljk/dvi2xx.c.orig	Sat Feb  6 22:46:34 1999
+++ texk/dviljk/dvi2xx.c	Mon Dec 16 20:56:42 2002
@@ -4107,13 +4107,17 @@ int  n;
         char *printer = "ljetplus"; /* use the most stupid one */
 
 
-        char scale_file_name[255];
-        char *scale_file = tmpnam(scale_file_name);
-        char *pcl_file = tmpnam(NULL);  
-        FILEPTR scalef;
+        char scale_file_name[] = "/tmp/dvi_scale.XXXXXXXXXX";
+        int scale_fd = mkstemp(scale_file_name);
+        FILEPTR scalef = fdopen(scale_fd, "w");
 
-        if ( (scalef = BOUTOPEN(scale_file)) == FPNULL ) {
-          Warning("Unable to open file %s for writing", scale_file );
+        char pcl_file_name[] = "/tmp/dvi_pcl.XXXXXXXXXX";
+        int pcl_fd = mkstemp(pcl_file_name);
+        close(pcl_fd);
+
+        if ( scalef == FPNULL ) {
+          Warning("Unable to open file %s for writing", scale_file_name );
+          close(scale_fd);
           return;
         }
         fprintf(scalef, "%.2f %.2f scale\n%d %d translate\n",  
@@ -4126,10 +4130,10 @@ int  n;
 	if (!gs_path)
 	  gs_path = "gswin32c.exe";
         sprintf(cmd,"%s -q -dSIMPLE -dSAFER -dNOPAUSE -sDEVICE=%s -sOutputFile=%s %s %s showpage.ps -c quit",
-		gs_path, printer, pcl_file, scale_file, psfile);
+		gs_path, printer, pcl_file_name, scale_file_name, psfile);
 #else
         sprintf(cmd,"gs -q -dSIMPLE -dSAFER -dNOPAUSE -sDEVICE=%s -sOutputFile=%s %s %s showpage.ps -c quit",
-                printer, pcl_file, scale_file, psfile);
+                printer, pcl_file_name, scale_file_name, psfile);
 #endif
 #ifdef DEBUGGS   
         fprintf(stderr,
@@ -4157,7 +4161,7 @@ int  n;
                   (int)PIXROUND(v, vconv) + y_goffset);
 #endif
 
-          CopyHPFile( pcl_file );
+          CopyHPFile( pcl_file_name );
           /* unlink(pcl_file); */
           /* unlink(scale_file); */
         }
