summaryrefslogtreecommitdiff
path: root/src/udev/udevadm-control.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-01-24 15:00:06 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-20 06:17:42 +0900
commit100bc5bf98ed051e94667c9581f7098856527ee9 (patch)
treed202042ea23122e37373c5e1ac1bd10912dea990 /src/udev/udevadm-control.c
parentebf963c551e1077abaa5e0fa0f330e6d1c23565e (diff)
downloadsystemd-100bc5bf98ed051e94667c9581f7098856527ee9.tar.gz
udev-ctrl: make udev_ctrl_new() return negative errno on failure
Diffstat (limited to 'src/udev/udevadm-control.c')
-rw-r--r--src/udev/udevadm-control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c
index 7cfc4c929d..b2fe69a1fd 100644
--- a/src/udev/udevadm-control.c
+++ b/src/udev/udevadm-control.c
@@ -86,9 +86,9 @@ int control_main(int argc, char *argv[], void *userdata) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"This command expects one or more options.");
- uctrl = udev_ctrl_new();
- if (!uctrl)
- return log_oom();
+ r = udev_ctrl_new(&uctrl);
+ if (r < 0)
+ return log_error_errno(r, "Failed to initialize udev control: %m");
while ((c = getopt_long(argc, argv, "el:sSRp:m:t:Vh", options, NULL)) >= 0)
switch (c) {