projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
17b89cd
)
monitor(1): Check kevent().
author
Sascha Wildner <saw@online.de>
Tue, 16 Oct 2012 04:36:09 +0000 (06:36 +0200)
committer
Sascha Wildner <saw@online.de>
Tue, 16 Oct 2012 06:50:29 +0000 (08:50 +0200)
Found-by: gcc47
usr.bin/monitor/monitor.c
patch
|
blob
|
blame
|
history
diff --git
a/usr.bin/monitor/monitor.c
b/usr.bin/monitor/monitor.c
index
bb438dc
..
277b006
100644
(file)
--- a/
usr.bin/monitor/monitor.c
+++ b/
usr.bin/monitor/monitor.c
@@
-122,7
+122,7
@@
monitor_add(const char *path)
{
monitor_elm_t elm;
struct kevent kev;
- int __unused n;
+ int n;
elm = malloc(sizeof(*elm));
bzero(elm, sizeof(*elm));
@@
-137,6
+137,10
@@
monitor_add(const char *path)
NOTE_LINK|NOTE_RENAME|NOTE_REVOKE,
0, NULL);
n = kevent(KQueueFd, &kev, 1, NULL, 0, NULL);
+ if (n < 0) {
+ perror("kqueue");
+ exit(1);
+ }
if (elm->fd >= NumFiles) {
MaxFiles = (elm->fd + 16) * 3 / 2;