Make sure SDL file descriptors don't leak into child processes

This commit is contained in:
Sam Lantinga
2021-09-08 14:47:40 -07:00
parent 3ed8ba7d33
commit bf97c5a22f
15 changed files with 24 additions and 24 deletions

View File

@@ -716,7 +716,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path, int bExclusive)
dev = new_hid_device();
/* OPEN HERE */
dev->device_handle = open(path, O_RDWR);
dev->device_handle = open(path, O_RDWR | O_CLOEXEC);
/* If we have a good handle, return it. */
if (dev->device_handle >= 0) {