mirror of
https://github.com/systemd/systemd.git
synced 2024-11-01 17:51:22 +03:00
Merge pull request #11409 from yuwata/udev-synthetic-errno
udev: update logs
This commit is contained in:
commit
0d432661fa
@ -240,7 +240,7 @@ static int builtin_blkid(sd_device *dev, int argc, char *argv[], bool test) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_device_error_errno(dev, r, "Failed to parse '%s' as an integer: %m", optarg);
|
return log_device_error_errno(dev, r, "Failed to parse '%s' as an integer: %m", optarg);
|
||||||
if (offset < 0)
|
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;
|
break;
|
||||||
case 'R':
|
case 'R':
|
||||||
noraid = true;
|
noraid = true;
|
||||||
|
@ -18,7 +18,7 @@ static int builtin_btrfs(sd_device *dev, int argc, char *argv[], bool test) {
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (argc != 3 || !streq(argv[1], "ready"))
|
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);
|
fd = open("/dev/btrfs-control", O_RDWR|O_CLOEXEC);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
@ -165,7 +165,7 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
|
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
|
||||||
if (r == 0)
|
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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ static int builtin_hwdb(sd_device *dev, int argc, char *argv[], bool test) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
|
return log_device_debug_errno(dev, r, "Failed to lookup hwdb: %m");
|
||||||
if (r == 0)
|
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;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 */
|
/* check if it's a numeric code already */
|
||||||
keycode_num = strtoul(keycode, &endptr, 0);
|
keycode_num = strtoul(keycode, &endptr, 0);
|
||||||
if (endptr[0] !='\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;
|
map.scan = scancode;
|
||||||
@ -152,7 +152,7 @@ static int set_trackpoint_sensitivity(sd_device *dev, const char *value) {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_device_error_errno(dev, r, "Failed to parse POINTINGSTICK_SENSITIVITY '%s': %m", value);
|
return log_device_error_errno(dev, r, "Failed to parse POINTINGSTICK_SENSITIVITY '%s': %m", value);
|
||||||
else if (val_i < 0 || val_i > 255)
|
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);
|
xsprintf(val_s, "%d", val_i);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ static int builtin_net_setup_link(sd_device *dev, int argc, char **argv, bool te
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (argc > 1)
|
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);
|
r = link_get_driver(ctx, dev, &driver);
|
||||||
if (r >= 0)
|
if (r >= 0)
|
||||||
|
@ -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);
|
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))
|
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);
|
devnode, id_filename);
|
||||||
|
|
||||||
if (apply) {
|
if (apply) {
|
||||||
|
Loading…
Reference in New Issue
Block a user