summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 13:19:16 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 13:29:21 +0100
commitda927ba997d68401563b927f92e6e40e021a8e5c (patch)
tree71764cd998aef07b8943c5206c9307a93ba9c528 /src/udev
parent0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (diff)
treewide: no need to negate errno for log_*_errno()
It corrrectly handles both positive and negative errno values.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/net/ethtool-util.c6
-rw-r--r--src/udev/net/link-config.c4
-rw-r--r--src/udev/udev-builtin-keyboard.c2
-rw-r--r--src/udev/udev-builtin-net_setup_link.c4
-rw-r--r--src/udev/udev-builtin-uaccess.c4
-rw-r--r--src/udev/udev-ctrl.c2
-rw-r--r--src/udev/udev-node.c4
-rw-r--r--src/udev/udev-rules.c4
-rw-r--r--src/udev/udevadm-hwdb.c4
-rw-r--r--src/udev/udevd.c6
10 files changed, 20 insertions, 20 deletions
diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
index e46d4d3d7c..4608a6c982 100644
--- a/src/udev/net/ethtool-util.c
+++ b/src/udev/net/ethtool-util.c
@@ -76,7 +76,7 @@ int ethtool_get_driver(int *fd, const char *ifname, char **ret) {
if (*fd < 0) {
r = ethtool_connect(fd);
if (r < 0) {
- log_warning_errno(-r, "link_config: could not connect to ethtool: %m");
+ log_warning_errno(r, "link_config: could not connect to ethtool: %m");
return r;
}
}
@@ -112,7 +112,7 @@ int ethtool_set_speed(int *fd, const char *ifname, unsigned int speed, Duplex du
if (*fd < 0) {
r = ethtool_connect(fd);
if (r < 0) {
- log_warning_errno(-r, "link_config: could not connect to ethtool: %m");
+ log_warning_errno(r, "link_config: could not connect to ethtool: %m");
return r;
}
}
@@ -172,7 +172,7 @@ int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol) {
if (*fd < 0) {
r = ethtool_connect(fd);
if (r < 0) {
- log_warning_errno(-r, "link_config: could not connect to ethtool: %m");
+ log_warning_errno(r, "link_config: could not connect to ethtool: %m");
return r;
}
}
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 97e260baed..7d1bdc9ee7 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -175,7 +175,7 @@ static bool enable_name_policy(void) {
r = proc_cmdline(&line);
if (r < 0) {
- log_warning_errno(-r, "Failed to read /proc/cmdline, ignoring: %m");
+ log_warning_errno(r, "Failed to read /proc/cmdline, ignoring: %m");
return true;
}
@@ -203,7 +203,7 @@ int link_config_load(link_config_ctx *ctx) {
r = conf_files_list_strv(&files, ".link", NULL, link_dirs);
if (r < 0) {
- log_error_errno(-r, "failed to enumerate link files: %m");
+ log_error_errno(r, "failed to enumerate link files: %m");
return r;
}
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index 6628ac873f..2deb8b9fbb 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -62,7 +62,7 @@ static int install_force_release(struct udev_device *dev, const unsigned int *re
log_debug("keyboard: updating force-release list with '%s'", codes);
ret = udev_device_set_sysattr_value(atkbd, "force_release", codes);
if (ret < 0)
- log_error_errno(-ret, "Error writing force-release attribute: %m");
+ log_error_errno(ret, "Error writing force-release attribute: %m");
return ret;
}
diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
index a1934f463e..87d10bf78f 100644
--- a/src/udev/udev-builtin-net_setup_link.c
+++ b/src/udev/udev-builtin-net_setup_link.c
@@ -46,14 +46,14 @@ static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
log_debug("No matching link configuration found.");
return EXIT_SUCCESS;
} else {
- log_error_errno(-r, "Could not get link config: %m");
+ log_error_errno(r, "Could not get link config: %m");
return EXIT_FAILURE;
}
}
r = link_config_apply(ctx, link, dev, &name);
if (r < 0) {
- log_error_errno(-r, "Could not apply link config to %s: %m", udev_device_get_sysname(dev));
+ log_error_errno(r, "Could not apply link config to %s: %m", udev_device_get_sysname(dev));
return EXIT_FAILURE;
}
diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c
index ecd320a588..591915435a 100644
--- a/src/udev/udev-builtin-uaccess.c
+++ b/src/udev/udev-builtin-uaccess.c
@@ -63,7 +63,7 @@ static int builtin_uaccess(struct udev_device *dev, int argc, char *argv[], bool
r = devnode_acl(path, true, false, 0, true, uid);
if (r < 0) {
- log_error_errno(-r, "Failed to apply ACL on %s: %m", path);
+ log_error_errno(r, "Failed to apply ACL on %s: %m", path);
goto finish;
}
@@ -77,7 +77,7 @@ finish:
/* Better be safe than sorry and reset ACL */
k = devnode_acl(path, true, false, 0, false, 0);
if (k < 0) {
- log_error_errno(-k, "Failed to apply ACL on %s: %m", path);
+ log_error_errno(k, "Failed to apply ACL on %s: %m", path);
if (r >= 0)
r = k;
}
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index d6cc9b493a..2c016da103 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -194,7 +194,7 @@ struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl) {
/* check peer credential of connection */
r = getpeercred(conn->sock, &ucred);
if (r < 0) {
- log_error_errno(-r, "unable to receive credentials of ctrl connection: %m");
+ log_error_errno(r, "unable to receive credentials of ctrl connection: %m");
goto err;
}
if (ucred.uid > 0) {
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index f105fa28e2..c9a273d003 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -304,7 +304,7 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
r = mac_selinux_apply(devnode, label);
if (r < 0)
- log_error_errno(-r, "SECLABEL: failed to set SELinux label '%s': %m", label);
+ log_error_errno(r, "SECLABEL: failed to set SELinux label '%s': %m", label);
else
log_debug("SECLABEL: set SELinux label '%s'", label);
@@ -313,7 +313,7 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
r = mac_smack_apply(devnode, label);
if (r < 0)
- log_error_errno(-r, "SECLABEL: failed to set SMACK label '%s': %m", label);
+ log_error_errno(r, "SECLABEL: failed to set SMACK label '%s': %m", label);
else
log_debug("SECLABEL: set SMACK label '%s'", label);
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 07c1f11033..eb56e270c1 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -1685,7 +1685,7 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names) {
r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
if (r < 0) {
- log_error_errno(-r, "failed to enumerate rules files: %m");
+ log_error_errno(r, "failed to enumerate rules files: %m");
return udev_rules_unref(rules);
}
@@ -2653,7 +2653,7 @@ int udev_rules_apply_static_dev_perms(struct udev_rules *rules) {
strscpyl(tags_dir, sizeof(tags_dir), "/run/udev/static_node-tags/", *t, "/", NULL);
r = mkdir_p(tags_dir, 0755);
if (r < 0) {
- log_error_errno(-r, "failed to create %s: %m", tags_dir);
+ log_error_errno(r, "failed to create %s: %m", tags_dir);
return r;
}
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
index 9a32fa8c6f..fa137c1cc2 100644
--- a/src/udev/udevadm-hwdb.c
+++ b/src/udev/udevadm-hwdb.c
@@ -618,7 +618,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
err = conf_files_list_strv(&files, ".hwdb", root, conf_file_dirs);
if (err < 0) {
- log_error_errno(-err, "failed to enumerate hwdb files: %m");
+ log_error_errno(err, "failed to enumerate hwdb files: %m");
rc = EXIT_FAILURE;
goto out;
}
@@ -652,7 +652,7 @@ static int adm_hwdb(struct udev *udev, int argc, char *argv[]) {
mkdir_parents(hwdb_bin, 0755);
err = trie_store(trie, hwdb_bin);
if (err < 0) {
- log_error_errno(-err, "Failure writing database %s: %m", hwdb_bin);
+ log_error_errno(err, "Failure writing database %s: %m", hwdb_bin);
rc = EXIT_FAILURE;
}
}
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 99b033b050..d1cc7788bc 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -962,7 +962,7 @@ static void kernel_cmdline_options(struct udev *udev) {
r = proc_cmdline(&line);
if (r < 0) {
- log_warning_errno(-r, "Failed to read /proc/cmdline, ignoring: %m");
+ log_warning_errno(r, "Failed to read /proc/cmdline, ignoring: %m");
return;
}
@@ -1135,7 +1135,7 @@ int main(int argc, char *argv[]) {
r = mac_selinux_init("/dev");
if (r < 0) {
- log_error_errno(-r, "could not initialize labelling: %m");
+ log_error_errno(r, "could not initialize labelling: %m");
goto exit;
}
@@ -1239,7 +1239,7 @@ int main(int argc, char *argv[]) {
rc = udev_rules_apply_static_dev_perms(rules);
if (rc < 0)
- log_error_errno(-rc, "failed to apply permissions on static device nodes - %m");
+ log_error_errno(rc, "failed to apply permissions on static device nodes - %m");
if (arg_daemonize) {
pid_t pid;