Skip to contentSkip to conversation

ell/dir.c: include limits.h for NAME_MAX

PATCH In review maxice8 2 participants 2 messages Oct 20, 2018 – Oct 21, 2018

lore
Share & tools
lore

maxice8

author
#0 lore raw

PATCH 1/1 ell/dir.c: include limits.h for NAME_MAX

From: William Maxwell <[email protected]>

fixes compilation on musl libc systems that are stricter

the error:

ell/dir.c: In function 'inotify_read_cb':
ell/dir.c:176:45: error: 'NAME_MAX' undeclared (first use in this function); did you mean 'SIZE_MAX'?
uint8_t buf[sizeof(struct inotify_event) + NAME_MAX + 1]

                                             ^~~~~~~~
                                             SIZE_MAX

ell/dir.c:176:45: note: each undeclared identifier is reported only once for each function it appears in

---
 ell/dir.c | 1 +
 1 file changed, 1 insertion(+)
ell/dir.c +1 -0
index d1870c8..7917664 100644
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <dirent.h>
 #include <sys/inotify.h>
+#include <limits.h>
 
 #include "private.h"
 #include "queue.h"
Signature · 1 line
2.19.1
#1 lore raw

Hi William,

Quoted 7 lines

fixes compilation on musl libc systems that are stricter

the error:

ell/dir.c: In function 'inotify_read_cb':
ell/dir.c:176:45: error: 'NAME_MAX' undeclared (first use in this function); did you mean 'SIZE_MAX'?
uint8_t buf[sizeof(struct inotify_event) + NAME_MAX + 1]

Quoted 8 lines
                                            ^~~~~~~~
                                            SIZE_MAX

ell/dir.c:176:45: note: each undeclared identifier is reported only once for each function it appears in

---
ell/dir.c | 1 +

1 file changed, 1 insertion(+)

a slightly modified patch has been applied.

Regards

Marcel