summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-09 06:09:51 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-09 06:09:51 +0000
commita40fb915f89d0e225058c0865de4504f83f90173 (patch)
tree55f62e116e01b2f2502be4d31767df616c06ca13
parent18e4e4462d27d3ce5484f3d007681c4b19bab919 (diff)
downloadglibc-a40fb915f89d0e225058c0865de4504f83f90173.tar.gz
(main): Rewrite initializers to avoid warnings.
-rw-r--r--linuxthreads/sysdeps/pthread/tst-timer.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/linuxthreads/sysdeps/pthread/tst-timer.c b/linuxthreads/sysdeps/pthread/tst-timer.c
index 9d80a7d900..4c62ef2170 100644
--- a/linuxthreads/sysdeps/pthread/tst-timer.c
+++ b/linuxthreads/sysdeps/pthread/tst-timer.c
@@ -61,8 +61,22 @@ main (void)
struct timespec ts;
timer_t timer_sig, timer_thr1, timer_thr2;
int retval;
- struct sigevent sigev1 = { SIGEV_SIGNAL, ZSIGALRM, { 0 }, notify_func, 0 };
- struct sigevent sigev2 = { SIGEV_THREAD, 0, { 0 }, notify_func, 0 };
+ struct sigevent sigev1 =
+ {
+ .sigev_notify = SIGEV_SIGNAL,
+ .sigev_signo = ZSIGALRM
+ };
+ struct sigevent sigev2 =
+ {
+ .sigev_notify = SIGEV_THREAD,
+ ._sigev_un =
+ {
+ ._sigev_thread =
+ {
+ ._function = notify_func
+ }
+ }
+ };
struct itimerspec itimer1 = { { 0, 200000000 }, { 0, 200000000 } };
struct itimerspec itimer2 = { { 0, 100000000 }, { 0, 500000000 } };
struct itimerspec itimer3 = { { 0, 150000000 }, { 0, 300000000 } };
@@ -80,20 +94,10 @@ main (void)
printf ("clock_getres returned %d, timespec = { %ld, %ld }\n",
retval, ts.tv_sec, ts.tv_nsec);
-#if 1
timer_create (CLOCK_REALTIME, &sigev1, &timer_sig);
-#else
- timer_create (CLOCK_REALTIME, 0, &timer_sig);
-#endif
-
timer_create (CLOCK_REALTIME, &sigev2, &timer_thr1);
timer_create (CLOCK_REALTIME, &sigev2, &timer_thr2);
-#if 0
- if (fork ())
- exit (1);
-#endif
-
timer_settime (timer_thr1, 0, &itimer2, &old);
timer_settime (timer_thr2, 0, &itimer3, &old);