]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
flock: fix timeout handler pointer usage
authorKarel Zak <kzak@redhat.com>
Thu, 5 Mar 2015 09:47:59 +0000 (10:47 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 5 Mar 2015 09:47:59 +0000 (10:47 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/monotonic.h
lib/monotonic.c

index d5ff7c8e582e6ae3439b8ab2580a500777cfd9bb..aca8b1fe4d44b3f2e29cc15d373afdf044930c04 100644 (file)
@@ -9,7 +9,7 @@ extern int get_boot_time(struct timeval *boot_time);
 extern int gettime_monotonic(struct timeval *tv);
 
 extern int setup_timer(timer_t * t_id, struct itimerval *timeout,
-                      void (*timeout_handler)(void));
+                      void (*timeout_handler)(int, siginfo_t *, void *));
 extern void cancel_timer(timer_t * t_id);
 
 #endif /* UTIL_LINUX_BOOTTIME_H */
index a124debba6c414546cc649a36d8568ef319dab03..c6e0f7572adfc8b4e81bc332ac5dbe636d4003d1 100644 (file)
@@ -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))