Commit a179f491 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Warn if failed to open device.

parent e0152e85
...@@ -231,12 +231,17 @@ static void find_joydevs(void) ...@@ -231,12 +231,17 @@ static void find_joydevs(void)
snprintf(buf, sizeof(buf), EVDEVPREFIX"%d", i); snprintf(buf, sizeof(buf), EVDEVPREFIX"%d", i);
if ((fd=open(buf, O_RDWR))==-1) { if ((fd = open(buf, O_RDWR)) == -1)
fd = open(buf, O_RDONLY); {
no_ff_check = 1; fd = open(buf, O_RDONLY);
} no_ff_check = 1;
}
if (fd!=-1) { if (fd == -1)
{
WARN("Failed to open \"%s\": %d %s\n", buf, errno, strerror(errno));
continue;
}
if ((-1==ioctl(fd,EVIOCGBIT(0,sizeof(joydev.evbits)),joydev.evbits))) { if ((-1==ioctl(fd,EVIOCGBIT(0,sizeof(joydev.evbits)),joydev.evbits))) {
perror("EVIOCGBIT 0"); perror("EVIOCGBIT 0");
...@@ -319,9 +324,8 @@ static void find_joydevs(void) ...@@ -319,9 +324,8 @@ static void find_joydevs(void)
have_joydevs++; have_joydevs++;
} }
close(fd); close(fd);
} }
}
} }
static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) static void fill_joystick_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment