diff --git a/src/lsi/mouse.c b/src/lsi/mouse.c index a502b24..5c3a1be 100644 --- a/src/lsi/mouse.c +++ b/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; }