use libc-internal malloc for pthread_atfork
[musl] / src / unistd / ualarm.c
index 855504b..2985855 100644 (file)
@@ -7,7 +7,7 @@ unsigned ualarm(unsigned value, unsigned interval)
        struct itimerval it = {
                .it_interval.tv_usec = interval,
                .it_value.tv_usec = value
-       };
-       setitimer(ITIMER_REAL, &it, &it);
-       return it.it_value.tv_sec*1000000 + it.it_value.tv_usec;
+       }, it_old;
+       setitimer(ITIMER_REAL, &it, &it_old);
+       return it_old.it_value.tv_sec*1000000 + it_old.it_value.tv_usec;
 }