diff options
Diffstat (limited to 'miscutils/inotifyd.c')
-rw-r--r-- | miscutils/inotifyd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/miscutils/inotifyd.c b/miscutils/inotifyd.c index 908d657fd..1d28e8f99 100644 --- a/miscutils/inotifyd.c +++ b/miscutils/inotifyd.c | |||
@@ -56,6 +56,7 @@ | |||
56 | //usage: "\nWhen x event happens for all FILEs, inotifyd exits." | 56 | //usage: "\nWhen x event happens for all FILEs, inotifyd exits." |
57 | 57 | ||
58 | #include "libbb.h" | 58 | #include "libbb.h" |
59 | #include "common_bufsiz.h" | ||
59 | #include <sys/inotify.h> | 60 | #include <sys/inotify.h> |
60 | 61 | ||
61 | static const char mask_names[] ALIGN1 = | 62 | static const char mask_names[] ALIGN1 = |
@@ -162,8 +163,9 @@ int inotifyd_main(int argc, char **argv) | |||
162 | // read out all pending events | 163 | // read out all pending events |
163 | // (NB: len must be int, not ssize_t or long!) | 164 | // (NB: len must be int, not ssize_t or long!) |
164 | xioctl(pfd.fd, FIONREAD, &len); | 165 | xioctl(pfd.fd, FIONREAD, &len); |
165 | #define eventbuf bb_common_bufsiz1 | 166 | #define eventbuf bb_common_bufsiz1 |
166 | ie = buf = (len <= sizeof(eventbuf)) ? eventbuf : xmalloc(len); | 167 | #define sizeof_eventbuf COMMON_BUFSIZE |
168 | ie = buf = (len <= sizeof_eventbuf) ? eventbuf : xmalloc(len); | ||
167 | len = full_read(pfd.fd, buf, len); | 169 | len = full_read(pfd.fd, buf, len); |
168 | // process events. N.B. events may vary in length | 170 | // process events. N.B. events may vary in length |
169 | while (len > 0) { | 171 | while (len > 0) { |