Line 0
Link Here
|
|
|
1 |
--- bin/cbsdsh/cbsd_fwatch.c.orig 2015-02-05 17:33:24.019144000 +0300 |
2 |
+++ bin/cbsdsh/cbsd_fwatch.c 2015-02-05 16:57:53.000000000 +0300 |
3 |
@@ -95,7 +95,6 @@ |
4 |
return 1; |
5 |
} |
6 |
|
7 |
- |
8 |
if ((fd = open(watchfile, O_RDONLY)) == -1) { |
9 |
out2fmt_flush("Cannot open: %s\n", watchfile); |
10 |
ckfree(watchfile); |
11 |
@@ -117,6 +116,7 @@ |
12 |
out2fmt_flush("kevent\n"); |
13 |
close(fd); |
14 |
ckfree(watchfile); |
15 |
+ close(kq); |
16 |
return 1; |
17 |
} |
18 |
|
19 |
@@ -134,9 +134,12 @@ |
20 |
out2fmt_flush("kevent\n"); |
21 |
close(fd); |
22 |
ckfree(watchfile); |
23 |
+ close(kq); |
24 |
return 1; |
25 |
} |
26 |
|
27 |
+ close(kq); |
28 |
+ |
29 |
if (nev != 0) { |
30 |
if (ev.fflags & NOTE_DELETE) { |
31 |
out2fmt_flush("deleted\n"); |
32 |
@@ -173,5 +176,7 @@ |
33 |
ev.fflags &= ~NOTE_REVOKE; |
34 |
} |
35 |
} |
36 |
+ |
37 |
+ ckfree(watchfile); |
38 |
return 0; |
39 |
} |