SITL: Sim_Vicon: set CLOEXEC on vicon file decsriptor

This commit is contained in:
Peter Barker 2018-06-29 13:38:08 +10:00 committed by Peter Barker
parent b197d05476
commit 6d6366df48
1 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,10 @@ Vicon::Vicon()
fd_my_end = tmp[1];
fd_their_end = tmp[0];
// close file descriptors on exec:
fcntl(fd_my_end, F_SETFD, FD_CLOEXEC);
fcntl(fd_their_end, F_SETFD, FD_CLOEXEC);
// make sure we don't screw the simulation up by blocking:
fcntl(fd_my_end, F_SETFL, fcntl(fd_my_end, F_GETFL, 0) | O_NONBLOCK);
fcntl(fd_their_end, F_SETFL, fcntl(fd_their_end, F_GETFL, 0) | O_NONBLOCK);