1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
From: Robert Ancell <robert.ancell@canonical.com>
Date: Fri, 19 Apr 2024 09:13:59 +1200
Subject: Fix tests failing on 32 bit architectures using 64 bit time
handling.
open/creat/stat are aliases to the 64 bit versions when this is enabled and
LightDM was therefore defining them twice.
Fixes https://github.com/canonical/lightdm/issues/352
---
tests/src/libsystem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index 1c68dc1..ebb60e7 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -242,6 +242,7 @@ open_wrapper (const char *func, const char *pathname, int flags, mode_t mode)
return _open (new_path, flags, mode);
}
+#ifndef __USE_FILE_OFFSET64
int
open (const char *pathname, int flags, ...)
{
@@ -255,6 +256,7 @@ open (const char *pathname, int flags, ...)
}
return open_wrapper ("open", pathname, flags, mode);
}
+#endif
int
open64 (const char *pathname, int flags, ...)
@@ -288,6 +290,7 @@ unlinkat (int dirfd, const char *pathname, int flags)
return _unlinkat (dirfd, new_path, flags);
}
+#ifndef __USE_FILE_OFFSET64
int
creat (const char *pathname, mode_t mode)
{
@@ -296,6 +299,7 @@ creat (const char *pathname, mode_t mode)
g_autofree gchar *new_path = redirect_path (pathname);
return _creat (new_path, mode);
}
+#endif
int
creat64 (const char *pathname, mode_t mode)
@@ -320,6 +324,7 @@ access (const char *pathname, int mode)
return _access (new_path, mode);
}
+#ifndef __USE_FILE_OFFSET64
int
stat (const char *path, struct stat *buf)
{
@@ -328,6 +333,7 @@ stat (const char *path, struct stat *buf)
g_autofree gchar *new_path = redirect_path (path);
return _stat (new_path, buf);
}
+#endif
int
stat64 (const char *path, struct stat64 *buf)
|