]> git.sesse.net Git - cubemap/blobdiff - util.cpp
Fix infinite CPU usage on waitpid().
[cubemap] / util.cpp
index a85de446a87f9451610f90c401f716e2fab86e5e..10e469df90c0a97c435c1eb405adb6ee5d9b7f7b 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -18,7 +18,7 @@ using namespace std;
 
 int make_tempfile(const string &contents)
 {
-       int fd = open("/tmp", O_RDWR | O_TMPFILE, 0600);
+       int fd = open("/tmp", O_RDWR | O_TMPFILE | O_CLOEXEC, 0600);
        if (fd == -1) {
                char filename[] = "/tmp/cubemap.XXXXXX";
                mode_t old_umask = umask(077);