summaryrefslogtreecommitdiff
path: root/src/time/timer_delete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/time/timer_delete.c')
-rw-r--r--src/time/timer_delete.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/time/timer_delete.c b/src/time/timer_delete.c
index 437de2e0..7c82b183 100644
--- a/src/time/timer_delete.c
+++ b/src/time/timer_delete.c
@@ -3,11 +3,7 @@
int timer_delete(timer_t t)
{
- pthread_t td = 0;
- int r;
- if ((uintptr_t)t & 1) t = (void *)((unsigned long)t / 2);
- else td = t, t = td->result;
- r = __syscall(SYS_timer_delete, (long)t);
- if (td) pthread_cancel(td);
- return r;
+ if ((uintptr_t)t & 1)
+ return __syscall(SYS_timer_delete, ((unsigned long)t / 2));
+ return pthread_cancel(t);
}