]> git.sesse.net Git - nageru/blobdiff - midi_mapper.cpp
Check the return value of writing to the eventfd.
[nageru] / midi_mapper.cpp
index 4f8c33bf4ca25071f21e5e93f5a180159520fb41..a81979650d8b500b171fa9f71028ac3a1dcde778 100644 (file)
@@ -51,7 +51,10 @@ MIDIMapper::~MIDIMapper()
 {
        should_quit = true;
        const uint64_t one = 1;
-       write(should_quit_fd, &one, sizeof(one));
+       if (write(should_quit_fd, &one, sizeof(one)) != sizeof(one)) {
+               perror("write(should_quit_fd)");
+               exit(1);
+       }
        midi_thread.join();
        close(should_quit_fd);
 }