summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/include/common.h
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-31 07:42:40 +0100
committerLeah Rowe <leah@libreboot.org>2026-03-31 07:42:40 +0100
commit2f7623ff06ca9b1b77c65ab7ba3acfe7ccf371d8 (patch)
tree685c63a6302898acb6b5b1407ec28e1662985bcb /util/libreboot-utils/include/common.h
parentfb5f1b4ed150087ee22c4ce9864fa9cd04178a9f (diff)
libreboot-utils: unified max path lengths
just use PATH_MAX like a normal person with additional safety Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/include/common.h')
-rw-r--r--util/libreboot-utils/include/common.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/util/libreboot-utils/include/common.h b/util/libreboot-utils/include/common.h
index 8276d6da..12c6c486 100644
--- a/util/libreboot-utils/include/common.h
+++ b/util/libreboot-utils/include/common.h
@@ -65,8 +65,10 @@ int fchmod(int fd, mode_t mode);
#define MAX_CMD_LEN 50
-#ifndef PATH_LEN
-#define PATH_LEN 4096
+#ifndef PATH_MAX
+#error PATH_MAX_undefined
+#elif ((PATH_MAX) < 1024)
+#error PATH_MAX_too_low
#endif
#define OFF_ERR 0
@@ -613,7 +615,7 @@ typedef char assert_read[(IO_READ==0)?1:-1];
typedef char assert_write[(IO_WRITE==1)?1:-1];
typedef char assert_pread[(IO_PREAD==2)?1:-1];
typedef char assert_pwrite[(IO_PWRITE==3)?1:-1];
-typedef char assert_pathlen[(PATH_LEN>=256)?1:-1];
+typedef char assert_pathlen[(PATH_MAX>=1024)?1:-1];
/* commands */
typedef char assert_cmd_dump[(CMD_DUMP==0)?1:-1];
typedef char assert_cmd_setmac[(CMD_SETMAC==1)?1:-1];