summaryrefslogtreecommitdiff
path: root/src/fstab-generator/fstab-generator.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:29:59 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:49:27 +0100
commit56f64d95763a799ba4475daf44d8e9f72a1bd474 (patch)
tree4c38253c718dc1972b811fa7c01ebfa3c2b7776c /src/fstab-generator/fstab-generator.c
parent895b3a7b44fe7ca2f260986be2a877ff56a72718 (diff)
treewide: use log_*_errno whenever %m is in the format string
If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r--src/fstab-generator/fstab-generator.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 4e50151ecd..1c85a729b8 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -111,7 +111,7 @@ static int add_swap(
if (errno == EEXIST)
log_error("Failed to create swap unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
else
- log_error("Failed to create unit file %s: %m", unit);
+ log_error_errno(errno, "Failed to create unit file %s: %m", unit);
return -errno;
}
@@ -149,7 +149,7 @@ static int add_swap(
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink %s: %m", lnk);
+ log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
return -errno;
}
}
@@ -229,7 +229,7 @@ static int add_mount(
if (errno == EEXIST)
log_error("Failed to create mount unit file %s, as it already exists. Duplicate entry in /etc/fstab?", unit);
else
- log_error("Failed to create unit file %s: %m", unit);
+ log_error_errno(errno, "Failed to create unit file %s: %m", unit);
return -errno;
}
@@ -269,7 +269,7 @@ static int add_mount(
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file %s: %m", unit);
+ log_error_errno(errno, "Failed to write unit file %s: %m", unit);
return -errno;
}
@@ -280,7 +280,7 @@ static int add_mount(
mkdir_parents_label(lnk, 0755);
if (symlink(unit, lnk) < 0) {
- log_error("Failed to create symlink %s: %m", lnk);
+ log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
return -errno;
}
}
@@ -297,7 +297,7 @@ static int add_mount(
fclose(f);
f = fopen(automount_unit, "wxe");
if (!f) {
- log_error("Failed to create unit file %s: %m", automount_unit);
+ log_error_errno(errno, "Failed to create unit file %s: %m", automount_unit);
return -errno;
}
@@ -320,7 +320,7 @@ static int add_mount(
fflush(f);
if (ferror(f)) {
- log_error("Failed to write unit file %s: %m", automount_unit);
+ log_error_errno(errno, "Failed to write unit file %s: %m", automount_unit);
return -errno;
}
@@ -331,7 +331,7 @@ static int add_mount(
mkdir_parents_label(lnk, 0755);
if (symlink(automount_unit, lnk) < 0) {
- log_error("Failed to create symlink %s: %m", lnk);
+ log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
return -errno;
}
}
@@ -351,7 +351,7 @@ static int parse_fstab(bool initrd) {
if (errno == ENOENT)
return 0;
- log_error("Failed to open %s: %m", fstab_path);
+ log_error_errno(errno, "Failed to open %s: %m", fstab_path);
return -errno;
}