openbsd-ports/astro/xephem/patches/patch-ac

30 lines
714 B
Plaintext

--- GUI/xephem/ps.c.~1~ Fri Nov 28 20:12:15 1997
+++ GUI/xephem/ps.c Tue Aug 4 21:13:53 1998
@@ -1657,16 +1657,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 */