File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ static int get_hid_report_descriptor(const char *rpt_path, struct hidraw_report_
384
384
int rpt_handle ;
385
385
ssize_t res ;
386
386
387
- rpt_handle = open (rpt_path , O_RDONLY );
387
+ rpt_handle = open (rpt_path , O_RDONLY | O_CLOEXEC );
388
388
if (rpt_handle < 0 ) {
389
389
register_global_error_format ("open failed (%s): %s" , rpt_path , strerror (errno ));
390
390
return -1 ;
@@ -473,7 +473,7 @@ static int parse_hid_vid_pid_from_uevent_path(const char *uevent_path, unsigned
473
473
int handle ;
474
474
ssize_t res ;
475
475
476
- handle = open (uevent_path , O_RDONLY );
476
+ handle = open (uevent_path , O_RDONLY | O_CLOEXEC );
477
477
if (handle < 0 ) {
478
478
register_global_error_format ("open failed (%s): %s" , uevent_path , strerror (errno ));
479
479
return 0 ;
@@ -981,7 +981,7 @@ hid_device * HID_API_EXPORT hid_open_path(const char *path)
981
981
982
982
dev = new_hid_device ();
983
983
984
- dev -> device_handle = open (path , O_RDWR );
984
+ dev -> device_handle = open (path , O_RDWR | O_CLOEXEC );
985
985
986
986
/* If we have a good handle, return it. */
987
987
if (dev -> device_handle >= 0 ) {
You can’t perform that action at this time.
0 commit comments