mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-23 19:25:25 +03:00
https://www.flamingspork.com/projects/libeatmydata/ An LD_PRELOAD library that disables all forms of writing data safely to disk
26 lines
840 B
Diff
26 lines
840 B
Diff
Upstream: https://github.com/stewartsmith/libeatmydata/pull/18
|
|
Reason: Libeatmydata redefines open and open64 so it can make those a NO_OP
|
|
for tests. Musl also defines these in fnctl.h, so we have to undefine them
|
|
to not get conflicting definitions
|
|
diff --git a/libeatmydata/libeatmydata.c b/libeatmydata/libeatmydata.c
|
|
index 8fe1b6a..95d940b 100644
|
|
--- a/libeatmydata/libeatmydata.c
|
|
+++ b/libeatmydata/libeatmydata.c
|
|
@@ -131,6 +131,8 @@ void LIBEATMYDATA_API sync(void)
|
|
(*libc_sync)();
|
|
}
|
|
|
|
+#undef open
|
|
+
|
|
int LIBEATMYDATA_API open(const char* pathname, int flags, ...)
|
|
{
|
|
va_list ap;
|
|
@@ -157,6 +159,8 @@ int LIBEATMYDATA_API open(const char* pathname, int flags, ...)
|
|
return (*libc_open)(pathname,flags,mode);
|
|
}
|
|
|
|
+#undef open64
|
|
+
|
|
#ifndef __USE_FILE_OFFSET64
|
|
int LIBEATMYDATA_API open64(const char* pathname, int flags, ...)
|
|
{
|