chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
log: rearrange log function naming
[elogind.git]
/
src
/
sysv-generator
/
sysv-generator.c
diff --git
a/src/sysv-generator/sysv-generator.c
b/src/sysv-generator/sysv-generator.c
index e5902ab8f8180751b4917990b0c3e999948cee0e..a2f853380cc49796a3ebeaee88aeff432c9e5b7a 100644
(file)
--- a/
src/sysv-generator/sysv-generator.c
+++ b/
src/sysv-generator/sysv-generator.c
@@
-31,7
+31,6
@@
#include "path-util.h"
#include "path-lookup.h"
#include "log.h"
#include "path-util.h"
#include "path-lookup.h"
#include "log.h"
-#include "strv.h"
#include "unit.h"
#include "unit-name.h"
#include "special.h"
#include "unit.h"
#include "unit-name.h"
#include "special.h"
@@
-193,7
+192,7
@@
static int generate_unit_file(SysvStub *s) {
STRV_FOREACH(p, s->wanted_by) {
r = add_symlink(s->name, *p);
if (r < 0)
STRV_FOREACH(p, s->wanted_by) {
r = add_symlink(s->name, *p);
if (r < 0)
- log_
error_unit
(s->name, "Failed to create 'Wants' symlink to %s: %s", *p, strerror(-r));
+ log_
unit_error
(s->name, "Failed to create 'Wants' symlink to %s: %s", *p, strerror(-r));
}
return 0;
}
return 0;
@@
-321,7
+320,7
@@
static int load_sysv(SysvStub *s) {
if (feof(f))
break;
if (feof(f))
break;
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"Failed to read configuration file '%s': %m",
s->path);
return -errno;
"Failed to read configuration file '%s': %m",
s->path);
return -errno;
@@
-396,7
+395,7
@@
static int load_sysv(SysvStub *s) {
fn = strstrip(t+8);
if (!path_is_absolute(fn)) {
fn = strstrip(t+8);
if (!path_is_absolute(fn)) {
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] PID file not absolute. Ignoring.",
s->path, line);
continue;
"[%s:%u] PID file not absolute. Ignoring.",
s->path, line);
continue;
@@
-490,12
+489,12
@@
static int load_sysv(SysvStub *s) {
}
if (r < 0)
}
if (r < 0)
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] Failed to add LSB Provides name %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
if (!isempty(state_))
"[%s:%u] Failed to add LSB Provides name %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
if (!isempty(state_))
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] Trailing garbage in Provides, ignoring.",
s->path, line);
"[%s:%u] Trailing garbage in Provides, ignoring.",
s->path, line);
@@
-518,7
+517,7
@@
static int load_sysv(SysvStub *s) {
r = sysv_translate_facility(n, basename(s->path), &m);
if (r < 0) {
r = sysv_translate_facility(n, basename(s->path), &m);
if (r < 0) {
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] Failed to translate LSB dependency %s, ignoring: %s",
s->path, line, n, strerror(-r));
continue;
"[%s:%u] Failed to translate LSB dependency %s, ignoring: %s",
s->path, line, n, strerror(-r));
continue;
@@
-552,12
+551,12
@@
static int load_sysv(SysvStub *s) {
}
if (r < 0)
}
if (r < 0)
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] Failed to add dependency on %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
if (!isempty(state_))
"[%s:%u] Failed to add dependency on %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
if (!isempty(state_))
- log_
error_unit
(s->name,
+ log_
unit_error
(s->name,
"[%s:%u] Trailing garbage in %*s, ignoring.",
s->path, line,
(int)(strchr(t, ':') - t), t);
"[%s:%u] Trailing garbage in %*s, ignoring.",
s->path, line,
(int)(strchr(t, ':') - t), t);
@@
-810,9
+809,8
@@
static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
goto finish;
}
goto finish;
}
- if (hashmap_contains(all_services, name))
- service = hashmap_get(all_services, name);
- else {
+ service = hashmap_get(all_services, name);
+ if (!service){
log_warning("Could not find init script for %s", name);
continue;
}
log_warning("Could not find init script for %s", name);
continue;
}