Index: GUI/xephem/ps.c
--- GUI/xephem/ps.c.orig
+++ GUI/xephem/ps.c
@@ -1693,16 +1693,24 @@ XtPointer call;
 	if (wantp) {
 	    /* print */
 	    char name[1024];
+	    int fd;
 
-	    (void) tmpnam (name);
+	    strcpy(name, "/tmp/xeXXXXXXXX");
 
+	    /*(void) tmpnam (name);*/
+	    fd = mkstemp(name);  
+
 	    /* VMS tmpnam() doesn't always include the required '.' */
 	    if (!strchr (name, '.'))
 		(void) strcat (name, ".ps");
 
 	    xpsc.prfile = XtNewString (name);
-	    if (XPSOpen (xpsc.prfile) == 0)
+	    if (XPSOpen (xpsc.prfile) == 0) {
+		close(fd);
 		call_go();
+	    }
+	    else
+		close(fd);
 
 	} else {
 	    /* save to file -- ask whether to clobber if it already exits */
