From 63729418992d5f63965a88fa2ac3570e3d270479 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Date: Sun, 22 Mar 2015 14:47:29 +0100 Subject: test: add utmpx test Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> --- test/misc/Makefile.in | 4 ++++ test/misc/tst-utmp.c | 15 +++++++++++++++ test/misc/tst-utmpx.c | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 test/misc/tst-utmpx.c (limited to 'test/misc') diff --git a/test/misc/Makefile.in b/test/misc/Makefile.in index 1e0da6f43..2fb9652fd 100644 --- a/test/misc/Makefile.in +++ b/test/misc/Makefile.in @@ -16,6 +16,10 @@ ifeq ($(UCLIBC_HAS_GLOB),) TESTS_DISABLED += bug-glob2 endif +ifeq ($(UCLIBC_HAS_UTMPX),) +TESTS_DISABLED += tst-utmpx +endif + DODIFF_dirent := 1 DODIFF_dirent64 := 1 DODIFF_tst-statfs := 1 diff --git a/test/misc/tst-utmp.c b/test/misc/tst-utmp.c index 08a6f8ea3..1b0333a32 100644 --- a/test/misc/tst-utmp.c +++ b/test/misc/tst-utmp.c @@ -37,6 +37,21 @@ # include <utmp.h> #endif +#ifndef _HAVE_UT_TYPE +# define _HAVE_UT_TYPE 0 +#endif +#ifndef _HAVE_UT_PID +# define _HAVE_UT_PID 0 +#endif +#ifndef _HAVE_UT_ID +# define _HAVE_UT_ID 0 +#endif +#ifndef _HAVE_UT_TV +# define _HAVE_UT_TV 0 +#endif +#ifndef _HAVE_UT_HOST +# define _HAVE_UT_HOST 0 +#endif #if _HAVE_UT_TYPE || defined UTMPX diff --git a/test/misc/tst-utmpx.c b/test/misc/tst-utmpx.c new file mode 100644 index 000000000..edb5551d7 --- /dev/null +++ b/test/misc/tst-utmpx.c @@ -0,0 +1,2 @@ +#define UTMPX +#include "tst-utmp.c" -- cgit v1.2.3 From 6ff9c31abc14f207265ab214370982ecb3bfe428 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Date: Wed, 25 Mar 2015 23:59:45 +0100 Subject: utmp: favour POSIX utmpx over SVID utmp Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the utmpx struct so this only changes the external API entrypoints and NOT the underlying data source. This saves about 500b (~1300b from previously ~1950) while at it. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> --- test/misc/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/misc') diff --git a/test/misc/Makefile.in b/test/misc/Makefile.in index 2fb9652fd..09f631fe3 100644 --- a/test/misc/Makefile.in +++ b/test/misc/Makefile.in @@ -20,6 +20,10 @@ ifeq ($(UCLIBC_HAS_UTMPX),) TESTS_DISABLED += tst-utmpx endif +ifeq ($(UCLIBC_HAS_UTMP),) +TESTS_DISABLED += tst-utmp +endif + DODIFF_dirent := 1 DODIFF_dirent64 := 1 DODIFF_tst-statfs := 1 -- cgit v1.2.3 From 9e552e6a2d836698834d2bf887dbf1806172729f Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Date: Wed, 25 Mar 2015 23:59:52 +0100 Subject: test: tweaks Fix arc4random exclusion for real. Silence warning about missing prototype for external helper-function in tst-scandir Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> --- test/misc/tst-scandir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/misc') diff --git a/test/misc/tst-scandir.c b/test/misc/tst-scandir.c index df62a40d4..e1c72e3c9 100644 --- a/test/misc/tst-scandir.c +++ b/test/misc/tst-scandir.c @@ -3,7 +3,7 @@ #include <stdio.h> /* perror() */ #include <stdlib.h> -int skip_all(const struct dirent *dirbuf) +static int skip_all(const struct dirent *dirbuf) { errno = EBADF; return 0; -- cgit v1.2.3