X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fsysv-generator%2Fsysv-generator.c;h=e6eef315e9b82b4e7f6f373cc873c79b2fcc623e;hb=4ec3cd7391e119b597375c547cf4ed50fce9f115;hp=5ff621d1fae7f5fefdd590f894cb1c522e97ab51;hpb=31938a8560a664c32a9d72f1fc2d4347b232e6e9;p=elogind.git diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c index 5ff621d1f..e6eef315e 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c @@ -143,10 +143,8 @@ static int generate_unit_file(SysvStub *s) { return log_oom(); f = fopen(unit, "wxe"); - if (!f) { - log_error("Failed to create unit file %s: %m", unit); - return -errno; - } + if (!f) + return log_error_errno(errno, "Failed to create unit file %s: %m", unit); fprintf(f, "# Automatically generated by systemd-sysv-generator\n\n" @@ -699,7 +697,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { d = opendir(*path); if (!d) { if (errno != ENOENT) - log_warning("opendir(%s) failed: %m", *path); + log_warning_errno(errno, "opendir(%s) failed: %m", *path); continue; } @@ -774,7 +772,7 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { d = opendir(path); if (!d) { if (errno != ENOENT) - log_warning("opendir(%s) failed: %m", path); + log_warning_errno(errno, "opendir(%s) failed: %m", path); continue; }