math: Fix some C++ test errors on Solaris 8.
[pspp] / lib / save-cwd.c
index 7394d50acce33b67a4b6351552d79ba7c799370e..cf43a355006b92c55e05dd40570e1d6b262990a2 100644 (file)
@@ -31,6 +31,7 @@
 #include "chdir-long.h"
 #include "unistd--.h"
 #include "xgetcwd.h"
+#include "cloexec.h"
 
 #if GNULIB_FCNTL_SAFER
 # include "fcntl--.h"
@@ -84,6 +85,7 @@ save_cwd (struct saved_cwd *cwd)
       return cwd->name ? 0 : -1;
     }
 
+  set_cloexec_flag (cwd->desc, true);
   return 0;
 }