diff --git a/plugins/out_file/file.c b/plugins/out_file/file.c
index 2e47c9666..42ace24c6 100644
--- a/plugins/out_file/file.c
+++ b/plugins/out_file/file.c
@@ -45,6 +45,9 @@
 #define NEWLINE "\n"
 #endif
 
+#undef PATH_MAX
+#define PATH_MAX 256
+
 struct flb_file_conf {
     const char *out_path;
     const char *out_file;
