[PATCH] erofs-utils: lib: Explicitly include <pthread.h> where used
Satoshi Niwa
niwa at google.com
Tue Oct 8 17:08:19 AEDT 2024
compress.c and inode.c use pthread functions but do not explicitly include <pthread.h>.
This causes build failures with the Android build system,
which throws "error: implicit declaration of function pthread_*".
Signed-off-by: Satoshi Niwa <niwa at google.com>
---
lib/compress.c | 3 +++
lib/inode.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/lib/compress.c b/lib/compress.c
index 17e7112..5d6fb2a 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -8,6 +8,9 @@
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
+#ifdef EROFS_MT_ENABLED
+#include <pthread.h>
+#endif
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/lib/inode.c b/lib/inode.c
index 7958d43..48f46b1 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -6,6 +6,9 @@
* with heavy changes by Gao Xiang <xiang at kernel.org>
*/
#define _GNU_SOURCE
+#ifdef EROFS_MT_ENABLED
+#include <pthread.h>
+#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
--
2.47.0.rc0.187.ge670bccf7e-goog
More information about the Linux-erofs
mailing list