Skip to content

Commit

Permalink
Fix tests failing on 32 bit architectures using 64 bit time handling.
Browse files Browse the repository at this point in the history
open/creat/stat are aliases to the 64 bit versions when this is enabled and
LightDM was therefore defining them twice.

Fixes canonical#352
  • Loading branch information
robert-ancell committed Apr 18, 2024
1 parent 38ad694 commit 8c22a51
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/libsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
{
Expand All @@ -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, ...)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
Expand All @@ -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)
{
Expand All @@ -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)
Expand Down

0 comments on commit 8c22a51

Please sign in to comment.