about summary refs log tree commit diff
path: root/src/unistd
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd')
-rw-r--r--src/unistd/ualarm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/unistd/ualarm.c b/src/unistd/ualarm.c
index 855504bc..2985855c 100644
--- a/src/unistd/ualarm.c
+++ b/src/unistd/ualarm.c
@@ -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;
 }