Skip to contentSkip to conversation

btrfs-progs: cmds: Fix build for using NAME_MAX

PATCH In review Sidong Yang 3 participants 3 messages Jul 25, 2021 – Jul 26, 2021 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 btrfs-progs: cmds: Fix build for using NAME_MAX

There is some code that using NAME_MAX but it doesn't include header that is defined. This patch adds a line that includes linux/limits.h which defines NAME_MAX.

Issue: #386

---
v2:
- Added tag for github issue

---
 cmds/filesystem-usage.c | 1 +
 1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
 #include <stdarg.h>
 #include <getopt.h>
 #include <fcntl.h>
+#include <linux/limits.h>
 
 #include "common/utils.h"
 #include "kerncompat.h"
Signature · 1 line
2.25.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Sidong Yang

There is some code that using NAME_MAX but it doesn't include header that is defined. This patch adds a line that includes linux/limits.h which defines NAME_MAX.

Issue: #386

Thanks,
Qu

Quoted 20 lines

---
v2:
- Added tag for github issue

---
  cmds/filesystem-usage.c | 1 +
  1 file changed, 1 insertion(+)
cmds/filesystem-usage.c +1 -0
index 50d8995e..2a76e29c 100644
@@ -24,6 +24,7 @@
  #include <stdarg.h>
  #include <getopt.h>
  #include <fcntl.h>
+#include <linux/limits.h>
 
  #include "common/utils.h"
  #include "kerncompat.h"
#2 lore raw
In reply to Sidong Yang
Quoted 7 lines · Sidong Yang

There is some code that using NAME_MAX but it doesn't include header that is defined. This patch adds a line that includes linux/limits.h which defines NAME_MAX.

Issue: #386

That was an easier than I thought, thanks. Verified by musl container build.