From e3ed156eeb241234f0ad7d12363172e655209654 Mon Sep 17 00:00:00 2001 From: Erik Andersen Date: Wed, 19 Apr 2000 18:52:56 +0000 Subject: Make the sys logger for so that concurrent logging will work properly (see tests/syslog_test.c for example). -Erik --- tests/.cvsignore | 1 + tests/Makefile | 2 ++ tests/syslog_test.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/syslog_test.c (limited to 'tests') diff --git a/tests/.cvsignore b/tests/.cvsignore index 5f8452313..3645cf92f 100644 --- a/tests/.cvsignore +++ b/tests/.cvsignore @@ -13,3 +13,4 @@ mv mv_*.bb mv_*.gnu mv_tests +syslog_test diff --git a/tests/Makefile b/tests/Makefile index c4fb0e911..508bc64f2 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -29,3 +29,5 @@ BBL := $(shell pushd .. >/dev/null && \ ${BBL}: ../busybox rm -f $@ ln ../busybox $@ + +syslog_test: syslog_test.c diff --git a/tests/syslog_test.c b/tests/syslog_test.c new file mode 100644 index 000000000..fb4c691b1 --- /dev/null +++ b/tests/syslog_test.c @@ -0,0 +1,19 @@ +#include + +int do_log(char* msg, int delay) +{ + openlog("testlog", LOG_PID, LOG_DAEMON); + while(1) { + syslog(LOG_ERR, "%s: testing one, two, three\n", msg); + sleep(delay); + } + closelog(); + return(0); +}; + +int main(void) +{ + if (fork()==0) + do_log("A", 2); + do_log("B", 3); +} -- cgit v1.2.3-55-g6feb