#include "udev.h"
-static void asmlinkage sig_handler(int signum)
+static void sig_handler(int signum)
{
switch (signum) {
case SIGALRM:
- exit(1);
+ _exit(1);
case SIGINT:
case SIGTERM:
- exit(20 + signum);
+ _exit(20 + signum);
}
}
/* set signal handlers */
memset(&act, 0x00, sizeof(act));
- act.sa_handler = (void (*)(int)) sig_handler;
+ act.sa_handler = sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGALRM, &act, NULL);
#include <stdint.h>
#include <errno.h>
-/* needed for our signal handlers to work */
-#undef asmlinkage
-#ifdef __i386__
-#define asmlinkage __attribute__((regparm(0)))
-#else
-#define asmlinkage
-#endif /* __i386__ */
-
#ifndef HAVE_INOTIFY
static inline int inotify_init(void)
{
static int udev_exit;
-static void asmlinkage sig_handler(int signum)
+static void sig_handler(int signum)
{
if (signum == SIGINT || signum == SIGTERM)
udev_exit = 1;
/* set signal handlers */
memset(&act, 0x00, sizeof(struct sigaction));
- act.sa_handler = (void (*)(int)) sig_handler;
+ act.sa_handler = sig_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
sigaction(SIGINT, &act, NULL);
#define DEFAULT_TIMEOUT 180
#define LOOP_PER_SECOND 20
-static int volatile is_timeout;
+static volatile sig_atomic_t is_timeout;
-static void asmlinkage sig_handler(int signum)
+static void sig_handler(int signum)
{
switch (signum) {
case SIGALRM:
/* set signal handlers */
memset(&act, 0x00, sizeof(act));
- act.sa_handler = (void (*)(int)) sig_handler;
+ act.sa_handler = sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGALRM, &act, NULL);
static struct udev_rules *rules;
static struct udev_ctrl *udev_ctrl;
static struct udev_monitor *kernel_monitor;
-static volatile int sigchilds_waiting;
-static volatile int udev_exit;
-static volatile int reload_config;
-static volatile int signal_received;
+static volatile sig_atomic_t sigchilds_waiting;
+static volatile sig_atomic_t udev_exit;
+static volatile sig_atomic_t reload_config;
+static volatile sig_atomic_t signal_received;
static volatile pid_t settle_pid;
static int run_exec_q;
static int stop_exec_q;
udev_event_unref(event);
}
-static void asmlinkage event_sig_handler(int signum)
+static void event_sig_handler(int signum)
{
if (signum == SIGALRM)
- exit(1);
+ _exit(1);
}
static void event_fork(struct udev_event *event)
/* set signal handlers */
memset(&act, 0x00, sizeof(act));
- act.sa_handler = (void (*)(int)) event_sig_handler;
+ act.sa_handler = event_sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = 0;
sigaction(SIGALRM, &act, NULL);
return 0;
}
-static void asmlinkage sig_handler(int signum)
+static void sig_handler(int signum)
{
switch (signum) {
case SIGINT:
/* set signal handlers */
memset(&act, 0x00, sizeof(struct sigaction));
- act.sa_handler = (void (*)(int)) sig_handler;
+ act.sa_handler = sig_handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
sigaction(SIGINT, &act, NULL);