From a449425fc86e6ef5ef2a1efb37b0cc645f1b0680 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 7 Feb 2011 12:02:53 +0100 Subject: Dynamically allocate inotify read buffer This fixes a sparse warning. --- inotail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index fe36a45..35fdd82 100644 --- a/inotail.c +++ b/inotail.c @@ -707,7 +707,7 @@ ignore: static int watch_files(struct file_struct *files, int n_files) { int ifd, i; - char buf[n_files * INOTIFY_BUFLEN]; + char *buf = emalloc(n_files * INOTIFY_BUFLEN); ifd = inotify_init(); if (errno == ENOSYS) { @@ -775,6 +775,7 @@ static int watch_files(struct file_struct *files, int n_files) } } + free(buf); close(ifd); return -1; -- cgit v1.2.3-54-g00ecf