diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/udev/udevd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index c021e806a4..5717edd435 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -1451,10 +1451,6 @@ static int manager_new(Manager **ret) { manager->worker_watch[WRITE_END] = -1; manager->worker_watch[READ_END] = -1; - r = sd_event_default(&manager->event); - if (r < 0) - return log_error_errno(errno, "could not allocate event loop: %m"); - manager->udev = udev_new(); if (!manager->udev) return log_error_errno(errno, "could not allocate udev context: %m"); @@ -1541,6 +1537,10 @@ static int manager_listen(Manager *manager) { sigfillset(&mask); sigprocmask(SIG_SETMASK, &mask, &manager->sigmask_orig); + r = sd_event_default(&manager->event); + if (r < 0) + return log_error_errno(errno, "could not allocate event loop: %m"); + r = sd_event_add_signal(manager->event, NULL, SIGINT, on_sigterm, manager); if (r < 0) return log_error_errno(r, "error creating sigint event source: %m"); |