Browse Source

Allow mouse plugin to fail gracefully

master
Gavan Fantom 18 years ago
parent
commit
6e77894ac7
  1. 14
      src/lsi/mouse.c

14
src/lsi/mouse.c

@ -52,15 +52,19 @@ int mouse_x, mouse_y, mouse_z;
int mouse_init(void)
{
mouse_x = 0;
mouse_y = 0;
mouse_z = 0;
mouse_fd = open(MOUSEDEVICE, O_RDONLY);
if (mouse_fd < 0)
err(1, "can't open mouse device");
if (mouse_fd < 0) {
warn("can't open mouse device");
mouse_initialised = 0;
return 0;
}
vm_register_signal_fd(mouse_fd, VM_MOUSEQ);
mouse_initialised = 1;
mouse_x = 0;
mouse_y = 0;
mouse_z = 0;
return 1;
}

Loading…
Cancel
Save