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 908d657..1d28e8f 100644 --- a/miscutils/inotifyd.c +++ b/miscutils/inotifyd.c @@ -56,6 +56,7 @@ //usage: "\nWhen x event happens for all FILEs, inotifyd exits." #include "libbb.h" +#include "common_bufsiz.h" #include <sys/inotify.h> static const char mask_names[] ALIGN1 = @@ -162,8 +163,9 @@ int inotifyd_main(int argc, char **argv) // read out all pending events // (NB: len must be int, not ssize_t or long!) xioctl(pfd.fd, FIONREAD, &len); -#define eventbuf bb_common_bufsiz1 - ie = buf = (len <= sizeof(eventbuf)) ? eventbuf : xmalloc(len); +#define eventbuf bb_common_bufsiz1 +#define sizeof_eventbuf COMMON_BUFSIZE + ie = buf = (len <= sizeof_eventbuf) ? eventbuf : xmalloc(len); len = full_read(pfd.fd, buf, len); // process events. N.B. events may vary in length while (len > 0) { |