]> git.sesse.net Git - nageru/commitdiff
Check the return value of writing to the eventfd.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Oct 2016 07:41:55 +0000 (09:41 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Oct 2016 16:48:36 +0000 (18:48 +0200)
alsa_pool.cpp
midi_mapper.cpp

index 3b6dd7ed3bcaab379accd31f26cd58e00e6de466..bcda16315329e87b039a5240a015e7b050c4d5d3 100644 (file)
@@ -41,7 +41,10 @@ ALSAPool::~ALSAPool()
        }
        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);
+       }
        inotify_thread.join();
 
        while (retry_threads_running > 0) {
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);
 }