summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-control.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-01-18 16:39:58 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-20 06:17:42 +0900
commita0b60b8a1b16217d9167d03c1c0ee7e4a362514f (patch)
tree35084783912c08dd15dbad70e9e53eafad88f96f /src/udev/udevadm-control.c
parentd02c6f546167d5f076a8940470db3a75ff12e814 (diff)
downloadsystemd-a0b60b8a1b16217d9167d03c1c0ee7e4a362514f.tar.gz
udevadm: print error if the commands fail
We'd exit with an error but no output. Print the error in the usual fashion.
Diffstat (limited to 'src/udev/udevadm-control.c')
-rw-r--r--src/udev/udevadm-control.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c
index b2fe69a1fd..01f6794297 100644
--- a/src/udev/udevadm-control.c
+++ b/src/udev/udevadm-control.c
@@ -95,7 +95,7 @@ int control_main(int argc, char *argv[], void *userdata) {
case 'e':
r = udev_ctrl_send_exit(uctrl, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send exit request: %m");
break;
case 'l':
r = log_level_from_string(optarg);
@@ -104,22 +104,22 @@ int control_main(int argc, char *argv[], void *userdata) {
r = udev_ctrl_send_set_log_level(uctrl, r, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send request to set log level: %m");
break;
case 's':
r = udev_ctrl_send_stop_exec_queue(uctrl, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send request to stop exec queue: %m");
break;
case 'S':
r = udev_ctrl_send_start_exec_queue(uctrl, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send request to start exec queue: %m");
break;
case 'R':
r = udev_ctrl_send_reload(uctrl, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send reload request: %m");
break;
case 'p':
if (!strchr(optarg, '='))
@@ -127,7 +127,7 @@ int control_main(int argc, char *argv[], void *userdata) {
r = udev_ctrl_send_set_env(uctrl, optarg, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send request to update environment: %m");
break;
case 'm': {
unsigned i;
@@ -138,7 +138,7 @@ int control_main(int argc, char *argv[], void *userdata) {
r = udev_ctrl_send_set_children_max(uctrl, i, timeout);
if (r < 0)
- return r;
+ return log_error_errno(r, "Failed to send request to set number of children: %m");
break;
}
case ARG_PING: