X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device-src%2Ftests%2Fsemaphore-test.c;h=2e523c73ab9474bb0665bafb4397e20173567bb2;hb=fb2bd066c2f8b34addafe48d62550e3033a59431;hp=cdfac17d66b4defac788fe1bae4758a131fca072;hpb=94a044f90357edefa6f4ae9f0b1d5885b0e34aee;p=debian%2Famanda diff --git a/device-src/tests/semaphore-test.c b/device-src/tests/semaphore-test.c index cdfac17..2e523c7 100644 --- a/device-src/tests/semaphore-test.c +++ b/device-src/tests/semaphore-test.c @@ -20,6 +20,7 @@ #include "semaphore.h" #include "amanda.h" +#include "util.h" /* * test that decrement waits properly @@ -49,12 +50,11 @@ static gboolean test_decr_wait(void) { GThread *th; - struct test_decr_wait_data data = { - semaphore_new_with_value(10), - FALSE - }; + struct test_decr_wait_data data = { NULL, FALSE }; int rv; + data.sem = semaphore_new_with_value(10), + /* die after 10 seconds (default signal disposition is to fail) */ alarm(10); @@ -254,7 +254,7 @@ main(void) gboolean pass = TRUE; #if defined(G_THREADS_ENABLED) && !defined(G_THREADS_IMPL_NONE) - amanda_thread_init(NULL); + amanda_thread_init(); pass = test_decr_wait() && pass; pass = test_wait_empty() && pass;