rcinput: open input device with apropriate flags

This commit is contained in:
Stefan Seyfried
2013-05-04 13:13:35 +02:00
parent e388b08dfe
commit d1cdbd34c8

View File

@@ -165,12 +165,8 @@ void CRCInput::open(int dev)
if (i != dev || fd_rc[i] != -1)
continue;
}
if ((fd_rc[i] = ::open(RC_EVENT_DEVICE[i], O_RDWR)) == -1)
if ((fd_rc[i] = ::open(RC_EVENT_DEVICE[i], O_RDWR|O_NONBLOCK|O_CLOEXEC)) == -1)
perror(RC_EVENT_DEVICE[i]);
else
{
fcntl(fd_rc[i], F_SETFL, O_NONBLOCK);
}
printf("CRCInput::open: %s fd %d\n", RC_EVENT_DEVICE[i], fd_rc[i]);
}