Merge branch 'deif/O_CLOEXEC' into 'master'

lib: use O_CLOEXEC flag when opening EtherCAT master device

See merge request etherlab.org/ethercat!56
This commit is contained in:
Florian Pose 2022-09-05 09:18:03 +00:00
commit e893051563
1 changed files with 2 additions and 2 deletions

View File

@ -97,9 +97,9 @@ ec_master_t *ecrt_open_master(unsigned int master_index)
master_index);
#ifdef USE_RTDM
master->fd = rt_dev_open(path, O_RDWR);
master->fd = rt_dev_open(path, O_RDWR | O_CLOEXEC);
#else
master->fd = open(path, O_RDWR);
master->fd = open(path, O_RDWR | O_CLOEXEC);
#endif
if (EC_IOCTL_IS_ERROR(master->fd)) {
EC_PRINT_ERR("Failed to open %s: %s\n", path,