void-packages/srcpkgs/mon/patches/fix-unused_result.patch
Jürgen Buchmüller 06e4f27b4e New package: mon-1.2.3
Closes #2468
2015-09-09 22:53:46 +02:00

14 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);
}