hide ignoring return value of write from compiler
Stefan Schuermans

Stefan Schuermans commited on 2020-05-26 15:29:30
Showing 1 changed files, with 3 additions and 2 deletions.

... ...
@@ -42,8 +42,9 @@ void uptpl_write(void const *data, size_t size) {
42 42
           (size >> 8) & 0xFF,
43 43
           size & 0xFF,
44 44
       }};
45
-  write(fd, &uptpl_event_header, sizeof(uptpl_event_header));
46
-  write(fd, data, size);
45
+  ssize_t written = write(fd, &uptpl_event_header, sizeof(uptpl_event_header));
46
+  written += write(fd, data, size);
47
+  (void)written; /* if writing failed, nobody there to receive the error */
47 48
   flock(fd, LOCK_UN);
48 49
   close(fd);
49 50
 }
50 51