summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-16 18:18:44 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:41 +0000
commit2b3966feba5dfec219c81749a629dacd0fea6823 (patch)
tree4dce3a9044942ee70cc0a05243670b675f052b37 /util
parent7650ab051f95ee1a44253fd4f4c3e1f02b2a8260 (diff)
util/nvmutil: portable S_IFMT
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util')
-rw-r--r--util/nvmutil/nvmutil.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index b76f44eb..580dc163 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -713,6 +713,14 @@ int tmp_fd = -1;
char *tname = NULL;
#ifndef S_ISREG
+#ifdef S_IFMT
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#else
+#define S_ISREG(m) (((m) & S_IFREG) == S_IFREG)
+#endif
+#endif
+
+#ifndef S_ISREG
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
#endif