diff --git a/plugins/in_tail/tail_file.c b/plugins/in_tail/tail_file.c index 13127b7e2b8..4ac39b3ee8b 100644 --- a/plugins/in_tail/tail_file.c +++ b/plugins/in_tail/tail_file.c @@ -819,7 +819,7 @@ void flb_tail_file_remove(struct flb_tail_file *file) flb_free(file->buf_data); flb_free(file->name); -#if !defined(__linux__) +#if !defined(__linux__) || !defined(FLB_HAVE_INOTIFY) flb_free(file->real_name); #endif @@ -1121,7 +1121,7 @@ int flb_tail_file_name_dup(char *path, struct flb_tail_file *file) } file->name_len = strlen(file->name); -#if !defined(__linux__) +#if !defined(__linux__) || !defined(FLB_HAVE_INOTIFY) if (file->real_name) { flb_free(file->real_name); } diff --git a/plugins/in_tail/tail_file.h b/plugins/in_tail/tail_file.h index 5fa80fc25d0..a935fc0e13b 100644 --- a/plugins/in_tail/tail_file.h +++ b/plugins/in_tail/tail_file.h @@ -51,7 +51,7 @@ static inline int flb_tail_file_name_cmp(char *name, static inline int flb_tail_target_file_name_cmp(char *name, struct flb_tail_file *file) { -#if defined(__linux__) +#if defined(__linux__) && defined(FLB_HAVE_INOTIFY) return strcmp(name, file->name); #elif defined(FLB_SYSTEM_WINDOWS) return _stricmp(name, file->real_name); diff --git a/plugins/in_tail/tail_file_internal.h b/plugins/in_tail/tail_file_internal.h index c59c297864e..9baa8e3cad4 100644 --- a/plugins/in_tail/tail_file_internal.h +++ b/plugins/in_tail/tail_file_internal.h @@ -44,7 +44,7 @@ struct flb_tail_file { ino_t inode; #endif char *name; /* target file name given by scan routine */ -#if !defined(__linux) +#if !defined(__linux) || !defined(FLB_HAVE_INOTIFY) char *real_name; /* real file name in the file system */ #endif size_t name_len;