From 8c22a5100f04c30be034cc12d9058ee88c6329d5 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Fri, 19 Apr 2024 09:13:59 +1200 Subject: [PATCH] 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 4007ab49..29be5d1d 100644 --- a/tests/src/libsystem.c +++ b/tests/src/libsystem.c @@ -266,6 +266,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, ...) { @@ -279,6 +280,7 @@ open (const char *pathname, int flags, ...) } return open_wrapper ("open", pathname, flags, mode); } +#endif int open64 (const char *pathname, int flags, ...) @@ -312,6 +314,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) { @@ -320,6 +323,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) @@ -344,6 +348,7 @@ access (const char *pathname, int mode) return _access (new_path, mode); } +#ifndef __USE_FILE_OFFSET64 int stat (const char *path, struct stat *buf) { @@ -352,6 +357,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)