openbsd-ports/astro/xephem/patches/patch-GUI_xephem_ps_c
2001-04-12 05:53:53 +00:00

30 lines
715 B
Plaintext

--- GUI/xephem/ps.c.orig Wed Feb 24 22:16:01 1999
+++ GUI/xephem/ps.c Fri Mar 12 11:46:34 1999
@@ -1693,16 +1693,24 @@
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 */