summaryrefslogtreecommitdiff
path: root/tests/tst-syslogd.c
diff options
context:
space:
mode:
authorEric Andersen2004-04-06 11:10:30 +0000
committerEric Andersen2004-04-06 11:10:30 +0000
commit650fe63467e693990cf357c51b74db3278088a56 (patch)
tree660b1fb0e4d7f99802a85cdd00166fafbf3132dc /tests/tst-syslogd.c
parent39396b95fc7c46bfa29ec576357fb7f8e755762c (diff)
downloadbusybox-650fe63467e693990cf357c51b74db3278088a56.zip
busybox-650fe63467e693990cf357c51b74db3278088a56.tar.gz
Kill off the old 'tests' stuff. Write a ton of new tests for the
'testsuite' dir. Fix a bunch of broken tests. Fix the testsuite 'runtest' script so it actually reports all failures and provides meaningful feedback. -Erik
Diffstat (limited to 'tests/tst-syslogd.c')
-rw-r--r--tests/tst-syslogd.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/tests/tst-syslogd.c b/tests/tst-syslogd.c
deleted file mode 100644
index bae10af..0000000
--- a/tests/tst-syslogd.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * tst-syslogd.c - tests concurrent threads calling syslog
- *
- * build with: gcc -Wall tst-syslogd.c -lpthread
- */
-
-#include <stdio.h>
-#include <pthread.h>
-#include <syslog.h>
-#include <unistd.h>
-
-void *log_func(void *arg)
-{
- int i;
- int thrid = (int)arg;
-
- openlog(NULL, LOG_PERROR | LOG_PID, LOG_USER);
- for (i = 0; i < 10; i++) {
- syslog(LOG_DEBUG, "thread %i iter %i\n", thrid, i);
- sleep(thrid); /* this mixes things up a bit */
- }
- closelog();
-
- return NULL;
-}
-
-int main(int argc, char **argv)
-{
- pthread_t thr1, thr2, thr3;
- int id1 = 1;
- int id2 = 2;
- int id3 = 3;
-
- pthread_create(&thr1, NULL, log_func, (void *)id1);
- pthread_create(&thr2, NULL, log_func, (void *)id2);
- pthread_create(&thr3, NULL, log_func, (void *)id3);
-
- pthread_join(thr1, NULL);
- pthread_join(thr2, NULL);
- pthread_join(thr3, NULL);
-
- return 0;
-}
-