Keep valgrind happy when calling timer_create
authorsven.panne@aedion.de <unknown>
Sun, 16 Sep 2007 11:19:27 +0000 (11:19 +0000)
committersven.panne@aedion.de <unknown>
Sun, 16 Sep 2007 11:19:27 +0000 (11:19 +0000)
Fill all of the sigevent structure with zeroes before individual fields are
set. Although not strictly necessary, this keeps tools like valgrind from
complaining about passing uninitialized data, which is a good thing.

MERGE TO STABLE

rts/posix/Itimer.c

index 1fcfa16..a60f8f1 100644 (file)
@@ -42,6 +42,8 @@
 # include <signal.h>
 #endif
 
+#include <string.h>
+
 /* Major bogosity:
  * 
  * In the threaded RTS, we can't set the virtual timer because the
@@ -143,6 +145,9 @@ initTicker (nat ms, TickProc handle_tick)
     {
         struct sigevent ev;
 
+       // Keep programs like valgrind happy
+       memset(&ev, 0, sizeof(ev));
+
         ev.sigev_notify = SIGEV_SIGNAL;
         ev.sigev_signo  = ITIMER_SIGNAL;