mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 20:08:13 +00:00
Make sure SDL file descriptors don't leak into child processes
This commit is contained in:
@@ -725,7 +725,7 @@ SDL_EVDEV_device_added(const char *dev_path, int udev_class)
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
|
||||
item->fd = open(dev_path, O_RDONLY | O_NONBLOCK);
|
||||
item->fd = open(dev_path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
if (item->fd < 0) {
|
||||
SDL_free(item);
|
||||
return SDL_SetError("Unable to open %s", dev_path);
|
||||
|
Reference in New Issue
Block a user