chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
networkctl: show interface names next to IP addresses if we dump adresses from all...
[elogind.git]
/
src
/
udev
/
udevadm-monitor.c
diff --git
a/src/udev/udevadm-monitor.c
b/src/udev/udevadm-monitor.c
index a54aa82c73fd614c2e668bea492a3fed6acbf1b7..1a5f516ddcbfe5937631d37a230de56fc2c574f5 100644
(file)
--- a/
src/udev/udevadm-monitor.c
+++ b/
src/udev/udevadm-monitor.c
@@
-37,14
+37,12
@@
static bool udev_exit;
static bool udev_exit;
-static void sig_handler(int signum)
-{
+static void sig_handler(int signum) {
if (signum == SIGINT || signum == SIGTERM)
udev_exit = true;
}
if (signum == SIGINT || signum == SIGTERM)
udev_exit = true;
}
-static void print_device(struct udev_device *device, const char *source, int prop)
-{
+static void print_device(struct udev_device *device, const char *source, int prop) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
@@
-75,8
+73,7
@@
static void help(void) {
" -h,--help\n\n");
}
" -h,--help\n\n");
}
-static int adm_monitor(struct udev *udev, int argc, char *argv[])
-{
+static int adm_monitor(struct udev *udev, int argc, char *argv[]) {
struct sigaction act = {};
sigset_t mask;
bool prop = false;
struct sigaction act = {};
sigset_t mask;
bool prop = false;
@@
-158,7
+155,7
@@
static int adm_monitor(struct udev *udev, int argc, char *argv[])
fd_ep = epoll_create1(EPOLL_CLOEXEC);
if (fd_ep < 0) {
fd_ep = epoll_create1(EPOLL_CLOEXEC);
if (fd_ep < 0) {
- log_error
(
"error creating epoll fd: %m");
+ log_error
_errno(errno,
"error creating epoll fd: %m");
return 1;
}
return 1;
}
@@
-198,7
+195,7
@@
static int adm_monitor(struct udev *udev, int argc, char *argv[])
ep_udev.events = EPOLLIN;
ep_udev.data.fd = fd_udev;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_udev, &ep_udev) < 0) {
ep_udev.events = EPOLLIN;
ep_udev.data.fd = fd_udev;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_udev, &ep_udev) < 0) {
- log_error
(
"fail to add fd to epoll: %m");
+ log_error
_errno(errno,
"fail to add fd to epoll: %m");
return 2;
}
return 2;
}
@@
-232,7
+229,7
@@
static int adm_monitor(struct udev *udev, int argc, char *argv[])
ep_kernel.events = EPOLLIN;
ep_kernel.data.fd = fd_kernel;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_kernel, &ep_kernel) < 0) {
ep_kernel.events = EPOLLIN;
ep_kernel.data.fd = fd_kernel;
if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_kernel, &ep_kernel) < 0) {
- log_error
(
"fail to add fd to epoll: %m");
+ log_error
_errno(errno,
"fail to add fd to epoll: %m");
return 5;
}
return 5;
}