2024-07-28 15:38:48 +00:00
|
|
|
From 75437e2253fc70f4e3368c9d030415ce4ae52fa6 Mon Sep 17 00:00:00 2001
|
2024-07-28 15:09:35 +00:00
|
|
|
From: Leah Rowe <info@minifree.org>
|
|
|
|
Date: Sun, 28 Jul 2024 16:04:30 +0100
|
|
|
|
Subject: [PATCH 1/1] common/filesystem: define ACCESSPERMS if undefined
|
|
|
|
|
2024-07-28 15:38:48 +00:00
|
|
|
Normally defined in sys/stat.h on various libc implementations,
|
2024-07-28 15:09:35 +00:00
|
|
|
but musl libc doesn't seem to have it, leading to this build
|
|
|
|
issue:
|
|
|
|
|
|
|
|
common/filesystem.cpp:86:38: error: 'ACCESSPERMS' was not declared in this scope
|
|
|
|
86 | return (mkdir(dir.toLocal8Bit(), ACCESSPERMS) == 0);
|
|
|
|
|
|
|
|
ACCESSPERMS is typically defined as the result of bitwise OR:
|
|
|
|
S_IRWXU | S_IRWXG | S_IRWXO
|
|
|
|
|
|
|
|
This creates the chmod permission 0777, used on the mkdir() call.
|
|
|
|
|
|
|
|
ACCESSPERMS is supported on GNU C Library, for compatibility with
|
|
|
|
BSD libc implementations; the latter also implements ALLPERMS
|
|
|
|
and DEFFILEMODE, which don't seem to be used by uefitool regardless.
|
|
|
|
|
2024-07-28 15:38:48 +00:00
|
|
|
Do not define it on the Windows builds; only do it for the others,
|
|
|
|
such as Linux.
|
|
|
|
|
2024-07-28 15:09:35 +00:00
|
|
|
Signed-off-by: Leah Rowe <info@minifree.org>
|
|
|
|
---
|
2024-07-28 15:38:48 +00:00
|
|
|
common/filesystem.cpp | 8 +++++++-
|
|
|
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
2024-07-28 15:09:35 +00:00
|
|
|
|
|
|
|
diff --git a/common/filesystem.cpp b/common/filesystem.cpp
|
2024-07-28 15:38:48 +00:00
|
|
|
index b2b8d65..af5e537 100644
|
2024-07-28 15:09:35 +00:00
|
|
|
--- a/common/filesystem.cpp
|
|
|
|
+++ b/common/filesystem.cpp
|
2024-07-28 15:38:48 +00:00
|
|
|
@@ -75,6 +75,12 @@ UString getAbsPath(const UString & path)
|
|
|
|
#else
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
+
|
|
|
|
+/* musl libc does not define ACCESSPERMS */
|
2024-07-28 15:09:35 +00:00
|
|
|
+#ifndef ACCESSPERMS
|
|
|
|
+#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* chmod permission: 0777 */
|
|
|
|
+#endif
|
|
|
|
+
|
2024-07-28 15:38:48 +00:00
|
|
|
bool isExistOnFs(const UString & path)
|
2024-07-28 15:09:35 +00:00
|
|
|
{
|
2024-07-28 15:38:48 +00:00
|
|
|
struct stat buf;
|
|
|
|
@@ -103,4 +109,4 @@ UString getAbsPath(const UString & path) {
|
2024-07-28 15:09:35 +00:00
|
|
|
return UString(abs);
|
|
|
|
return path;
|
|
|
|
}
|
|
|
|
-#endif
|
|
|
|
\ No newline at end of file
|
|
|
|
+#endif
|
|
|
|
--
|
|
|
|
2.39.2
|
|
|
|
|