src/Input/FGLinuxEventInput.cxx: don't throw if we cannot open device.
Throwing halts execution; we now output a diagnostic and return false, and flightgear appears ok to continue.
This commit is contained in:
parent
f3ef077730
commit
c4c29f33d4
1 changed files with 7 additions and 2 deletions
|
@ -290,8 +290,13 @@ static inline bool bitSet( unsigned char * buf, unsigned bit )
|
||||||
bool FGLinuxInputDevice::Open()
|
bool FGLinuxInputDevice::Open()
|
||||||
{
|
{
|
||||||
if( fd != -1 ) return true;
|
if( fd != -1 ) return true;
|
||||||
if( (fd = ::open( devname.c_str(), O_RDWR )) == -1 ) {
|
if( (fd = ::open( devname.c_str(), O_RDWR )) == -1 ) {
|
||||||
throw std::exception();
|
SG_LOG( SG_INPUT, SG_ALERT, "Cannot open devname='" << devname
|
||||||
|
<< "'. errno=" << errno
|
||||||
|
<< ": " << strerror(errno)
|
||||||
|
);
|
||||||
|
//throw std::exception();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GetGrab() && ioctl( fd, EVIOCGRAB, 2 ) == -1 ) {
|
if( GetGrab() && ioctl( fd, EVIOCGRAB, 2 ) == -1 ) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue