mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-10 09:53:58 -04:00
AP_Gripper: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor when we are exec'ing or calling out subprograms. Right now we currently don't do it so there's no harm, but it's good practice in Linux to have it.
This commit is contained in:
parent
8cec2c188f
commit
b7e5f56bd7
@ -22,7 +22,7 @@ AP_Gripper_EPM::AP_Gripper_EPM(struct AP_Gripper::Backend_Config &_config) :
|
||||
void AP_Gripper_EPM::init_gripper()
|
||||
{
|
||||
#ifdef UAVCAN_NODE_FILE
|
||||
_uavcan_fd = ::open(UAVCAN_NODE_FILE, 0);
|
||||
_uavcan_fd = ::open(UAVCAN_NODE_FILE, O_CLOEXEC);
|
||||
// http://ardupilot.org/dev/docs/learning-ardupilot-uarts-and-the-console.html
|
||||
::printf("EPM: UAVCAN fd %d\n", _uavcan_fd);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user