2002-03-21 00:28:20 -05:00
|
|
|
$OpenBSD: patch-ddd_plotter_C,v 1.2 2002/03/21 05:28:21 fgsch Exp $
|
|
|
|
--- ddd/plotter.C.orig Tue Jan 9 15:15:22 2001
|
|
|
|
+++ ddd/plotter.C Wed Mar 13 04:32:03 2002
|
|
|
|
@@ -429,7 +429,14 @@ static void configure_plot(PlotWindowInf
|
2000-10-30 08:54:50 -05:00
|
|
|
new StatusDelay("Retrieving Plot Settings");
|
|
|
|
|
|
|
|
// Save settings...
|
|
|
|
- plot->settings_file = tmpnam(0);
|
|
|
|
+ // gnuplot has no compunction about saving twice to the same
|
|
|
|
+ // file, so we can make this safe
|
|
|
|
+ char temp_name[] = "/tmp/ddd.XXXXXXXXXX";
|
|
|
|
+ int fd = mkstemp(temp_name);
|
|
|
|
+ if (fd == 0)
|
|
|
|
+ return;
|
|
|
|
+ close(fd);
|
|
|
|
+ plot->settings_file = temp_name;
|
|
|
|
string cmd = "save " + quote(plot->settings_file) + "\n";
|
|
|
|
send(plot, cmd);
|
|
|
|
|