The unified diff between revisions [4839c414..] and [63fe9cf9..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'src/lsi/mouse.c'
# # old_revision [4839c414876f813b3873cc350a8e42d6c01957fc] # new_revision [63fe9cf91eccf15b977d5be7600ee10a17d08d95] # # patch "src/lsi/mouse.c" # from [c096818b43c9e38bc12de94291b888582fa7bcec] # to [410738f63d15db286b591fff6040fcdfe9e1cfa6] # ============================================================ --- src/lsi/mouse.c c096818b43c9e38bc12de94291b888582fa7bcec +++ src/lsi/mouse.c 410738f63d15db286b591fff6040fcdfe9e1cfa6 @@ -50,17 +50,24 @@ int mouse_x, mouse_y, mouse_z; int mouse_initialised = 0; int mouse_x, mouse_y, mouse_z; -void mouse_init(void) +int mouse_init(void) { + mouse_x = 0; + mouse_y = 0; + mouse_z = 0; + mouse_bytes = 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; } void mouse_close(void)