summaryrefslogtreecommitdiffstats
path: root/lib/monotonic.c
diff options
context:
space:
mode:
authorKarel Zak2015-03-05 10:47:59 +0100
committerKarel Zak2015-03-05 10:47:59 +0100
commit46cd5b1767c3ca638a3f9170bfc4463bc83b62b4 (patch)
tree333262813436fd4addf02000dc2a2d893f826e31 /lib/monotonic.c
parentwhereis: make "-BMS <dir> -f" more obvious in usage() (diff)
downloadkernel-qcow2-util-linux-46cd5b1767c3ca638a3f9170bfc4463bc83b62b4.tar.gz
kernel-qcow2-util-linux-46cd5b1767c3ca638a3f9170bfc4463bc83b62b4.tar.xz
kernel-qcow2-util-linux-46cd5b1767c3ca638a3f9170bfc4463bc83b62b4.zip
flock: fix timeout handler pointer usage
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/monotonic.c')
-rw-r--r--lib/monotonic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/monotonic.c b/lib/monotonic.c
index a124debba..c6e0f7572 100644
--- a/lib/monotonic.c
+++ b/lib/monotonic.c
@@ -69,7 +69,7 @@ int gettime_monotonic(struct timeval *tv)
}
int setup_timer(timer_t * t_id, struct itimerval *timeout,
- void (*timeout_handler)(void))
+ void (*timeout_handler)(int, siginfo_t *, void *))
{
struct sigaction sig_a;
static struct sigevent sig_e = {
@@ -85,8 +85,10 @@ int setup_timer(timer_t * t_id, struct itimerval *timeout,
if (sigemptyset(&sig_a.sa_mask))
return 1;
+
sig_a.sa_flags = SA_SIGINFO;
- sig_a.sa_handler = timeout_handler;
+ sig_a.sa_sigaction = timeout_handler;
+
if (sigaction(SIGALRM, &sig_a, 0))
return 1;
if (timer_create(CLOCK_MONOTONIC, &sig_e, t_id))