chiark / gitweb /
memfd: always create our memfds with CLOEXEC set
[elogind.git] / src / shared / memfd.c
index 162c12f7a77e035e472ca4d2bc470c7852e8551c..f3ce8f84da50a9eb0c3ce6c9727f1c2df8033677 100644 (file)
@@ -65,7 +65,7 @@ int memfd_new(const char *name) {
                 }
         }
 
-        fd = memfd_create(name, MFD_ALLOW_SEALING);
+        fd = memfd_create(name, MFD_ALLOW_SEALING | MFD_CLOEXEC);
         if (fd < 0)
                 return -errno;