On 09/03/2016 07:07, Peter Xu wrote: > - char buf[len]; > + char buf[sizeof(struct inotify_event) + NAME_MAX + 1]; > > for (;;) { > - bytes = read(s->inotifyfd, buf, len); > + bytes = read(s->inotifyfd, buf, sizeof(buf));
sizeof is good here, since read takes a size in bytes. Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>