[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH 1/3] libc: POSIX: alarm(0)
! libc: POSIX: alarm(0) bricht nur laufende Timer ab, aber erstellt
keinen neuen.
Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
src/modules/lib/posix/signal.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/src/modules/lib/posix/signal.c b/src/modules/lib/posix/signal.c
index 4b9fe5a..ef95739 100644
--- a/src/modules/lib/posix/signal.c
+++ b/src/modules/lib/posix/signal.c
@@ -368,7 +368,11 @@ long alarm(long seconds)
timer_cancel(id);
}
- id = timer_register(do_alarm, seconds * 1000000);
+ if (seconds != 0) {
+ id = timer_register(do_alarm, seconds * 1000000);
+ } else {
+ id = 0;
+ }
// FIXME
return 0;
--
1.6.0.2