void-packages/srcpkgs/mon/patches/fix-unused_result.patch

15 lines
429 B
Diff

Fix a minor warning about ignoring the result of write(2).
--- src/mon.c 2013-12-01 18:34:08.000000000 +0100
+++ src/mon.c 2015-09-09 22:42:21.241394637 +0200
@@ -112,7 +112,8 @@
snprintf(buf, 32, "%d", pid);
int fd = open(file, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0) perror("open()");
- write(fd, buf, 32);
+ ssize_t wrote = write(fd, buf, 32);
+ if (wrote != 32) perror("write()");
close(fd);
}