diff options
author | Erik Andersen | 2000-04-19 18:52:56 +0000 |
---|---|---|
committer | Erik Andersen | 2000-04-19 18:52:56 +0000 |
commit | e3ed156eeb241234f0ad7d12363172e655209654 (patch) | |
tree | 60af21090f97b033785093ed00a123006808cf88 /tests/syslog_test.c | |
parent | 1101d23604dae236063938c23470c85c17f76988 (diff) | |
download | busybox-e3ed156eeb241234f0ad7d12363172e655209654.zip busybox-e3ed156eeb241234f0ad7d12363172e655209654.tar.gz |
Make the sys logger for so that concurrent logging will work
properly (see tests/syslog_test.c for example).
-Erik
Diffstat (limited to 'tests/syslog_test.c')
-rw-r--r-- | tests/syslog_test.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/syslog_test.c b/tests/syslog_test.c new file mode 100644 index 0000000..fb4c691 --- /dev/null +++ b/tests/syslog_test.c @@ -0,0 +1,19 @@ +#include <syslog.h> + +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); +} |