>From 675d6027ed01a4dc971d8fe8cdd8fee9eae209b7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 27 Jan 2019 11:39:56 +0100 Subject: [PATCH 4/4] tests: Enable Linux specific tests on Android. * tests/test-flock.c (main): Treat Android like Linux. * tests/test-openat-safer.c (main): Likewise. --- ChangeLog | 6 ++++++ tests/test-flock.c | 2 +- tests/test-openat-safer.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82fc48f..5c77d69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2019-01-27 Bruno Haible + tests: Enable Linux specific tests on Android. + * tests/test-flock.c (main): Treat Android like Linux. + * tests/test-openat-safer.c (main): Likewise. + +2019-01-27 Bruno Haible + relocatable-prog: Use Linux code on Android. * lib/progreloc.c: Treat Android like Linux. diff --git a/tests/test-flock.c b/tests/test-flock.c index ff688bc..aa428ff 100644 --- a/tests/test-flock.c +++ b/tests/test-flock.c @@ -98,7 +98,7 @@ main (int argc, char *argv[]) ASSERT (fd >= 0); ASSERT (write (fd, "hello", 5) == 5); -#if defined __linux__ +#if defined __linux__ || defined __ANDROID__ /* Invalid operation codes are rejected by the Linux implementation and by the gnulib replacement, but not by the Mac OS X implementation. */ ASSERT (flock (fd, LOCK_SH | LOCK_EX) == -1); diff --git a/tests/test-openat-safer.c b/tests/test-openat-safer.c index 042e488..7971168 100644 --- a/tests/test-openat-safer.c +++ b/tests/test-openat-safer.c @@ -96,7 +96,7 @@ main (void) errno = 0; ASSERT (openat (dfd, witness "/", O_RDONLY) == -1); ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL); -#ifdef __linux__ +#if defined __linux__ || defined __ANDROID__ /* Using a bad directory is okay for absolute paths. */ fd = openat (-1, "/dev/null", O_WRONLY); ASSERT (STDERR_FILENO < fd); -- 2.7.4