Make the sys logger for so that concurrent logging will work
properly (see tests/syslog_test.c for example). -Erik
This commit is contained in:
@@ -13,3 +13,4 @@ mv
|
||||
mv_*.bb
|
||||
mv_*.gnu
|
||||
mv_tests
|
||||
syslog_test
|
||||
|
||||
@@ -29,3 +29,5 @@ BBL := $(shell pushd .. >/dev/null && \
|
||||
${BBL}: ../busybox
|
||||
rm -f $@
|
||||
ln ../busybox $@
|
||||
|
||||
syslog_test: syslog_test.c
|
||||
|
||||
19
tests/syslog_test.c
Normal file
19
tests/syslog_test.c
Normal file
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user