summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-01-13 11:11:22 +0100
committerGitHub <noreply@github.com>2019-01-13 11:11:22 +0100
commit0d432661faa6945e09a750e0e817e3c1d1c06112 (patch)
tree625cb276ae0cb1f7235a7d15f11c40f8446f8162
parentMerge pull request #11393 from mrc0mmand/fix-service-masking-in-TEST-01-BASIC (diff)
parentudev: use ENODATA when 'No entry found from hwdb' (diff)
downloadsystemd-0d432661faa6945e09a750e0e817e3c1d1c06112.tar.xz
systemd-0d432661faa6945e09a750e0e817e3c1d1c06112.zip
Merge pull request #11409 from yuwata/udev-synthetic-errno
udev: update logs
-rw-r--r--src/udev/udev-builtin-blkid.c2
-rw-r--r--src/udev/udev-builtin-btrfs.c2
-rw-r--r--src/udev/udev-builtin-hwdb.c4
-rw-r--r--src/udev/udev-builtin-keyboard.c4
-rw-r--r--src/udev/udev-builtin-net_setup_link.c2
-rw-r--r--src/udev/udev-node.c2
6 files changed, 8 insertions, 8 deletions
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
index df0f95461d..69d6c4bbee 100644
--- a/src/udev/udev-builtin-blkid.c
+++ b/src/udev/udev-builtin-blkid.c
@@ -240,7 +240,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
if (r < 0)
return log_device_error_errno(dev, r, "Failed to parse '%s' as an integer: %m", optarg);
if (offset < 0)
- return log_device_error_errno(dev, -ERANGE, "Invalid offset %"PRIi64": %m", offset);
+ return log_device_error_errno(dev, SYNTHETIC_ERRNO(ERANGE), "Invalid offset %"PRIi64": %m", offset);
break;
case 'R':
noraid = true;
diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c
index 85dba3d099..956be59afb 100644
--- a/src/udev/udev-builtin-btrfs.c
+++ b/src/udev/udev-builtin-btrfs.c
@@ -18,7 +18,7 @@ static int builtin_btrfs(sd_device *dev, int argc, char *argv[], bool test) {
int r;
if (argc != 3 || !streq(argv[1], "ready"))
- return log_device_error_errno(dev, EINVAL, "Invalid arguments");
+ return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), "Invalid arguments");
fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC);
if (fd < 0)
diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
index ccad98e892..225e0265a4 100644
--- a/src/udev/udev-builtin-hwdb.c
+++ b/src/udev/udev-builtin-hwdb.c
@@ -165,7 +165,7 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
if (r < 0)
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
if (r == 0)
- return log_device_debug_errno(dev, ENOENT, "No entry found from hwdb: %m");
+ return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENODATA), "No entry found from hwdb.");
return r;
}
@@ -180,7 +180,7 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
if (r < 0)
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
if (r == 0)
- return log_device_debug_errno(dev, ENOENT, "No entry found from hwdb: %m");
+ return log_device_debug_errno(dev, SYNTHETIC_ERRNO(ENODATA), "No entry found from hwdb.");
return r;
}
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index cb49a17c33..1eb91f0a78 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -74,7 +74,7 @@ static int map_keycode(sd_device *dev, int fd, int scancode, const char *keycode
/* check if it's a numeric code already */
keycode_num = strtoul(keycode, &endptr, 0);
if (endptr[0] !='\0')
- return log_device_error_errno(dev, EINVAL, "Failed to parse key identifier '%s'", keycode);
+ return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), "Failed to parse key identifier '%s'", keycode);
}
map.scan = scancode;
@@ -152,7 +152,7 @@ static int set_trackpoint_sensitivity(sd_device *dev, const char *value) {
if (r < 0)
return log_device_error_errno(dev, r, "Failed to parse POINTINGSTICK_SENSITIVITY '%s': %m", value);
else if (val_i < 0 || val_i > 255)
- return log_device_error_errno(dev, ERANGE, "POINTINGSTICK_SENSITIVITY %d outside range [0..255]", val_i);
+ return log_device_error_errno(dev, SYNTHETIC_ERRNO(ERANGE), "POINTINGSTICK_SENSITIVITY %d outside range [0..255]", val_i);
xsprintf(val_s, "%d", val_i);
diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
index c0d3d4aa01..a845dfa5c1 100644
--- a/src/udev/udev-builtin-net_setup_link.c
+++ b/src/udev/udev-builtin-net_setup_link.c
@@ -16,7 +16,7 @@ static int builtin_net_setup_link(sd_device *dev, int argc, char **argv, bool te
int r;
if (argc > 1)
- return log_device_error_errno(dev, EINVAL, "This program takes no arguments.");
+ return log_device_error_errno(dev, SYNTHETIC_ERRNO(EINVAL), "This program takes no arguments.");
r = link_get_driver(ctx, dev, &driver);
if (r >= 0)
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index c77010c09b..1c00dd1e9e 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -300,7 +300,7 @@ static int node_permissions_apply(sd_device *dev, bool apply,
return log_device_debug_errno(dev, errno, "cannot stat() node '%s' (%m)", devnode);
if (((stats.st_mode & S_IFMT) != (mode & S_IFMT)) || (stats.st_rdev != devnum))
- return log_device_debug_errno(dev, EEXIST, "Found node '%s' with non-matching devnum %s, skip handling",
+ return log_device_debug_errno(dev, SYNTHETIC_ERRNO(EEXIST), "Found node '%s' with non-matching devnum %s, skip handling",
devnode, id_filename);
if (apply) {