#include "path-util.h"
#include "path-lookup.h"
#include "log.h"
-#include "strv.h"
#include "unit.h"
#include "unit-name.h"
#include "special.h"
}
static int generate_unit_file(SysvStub *s) {
- char *unit;
char **p;
_cleanup_fclose_ FILE *f = NULL;
+ _cleanup_free_ char *unit = NULL;
_cleanup_free_ char *before = NULL;
_cleanup_free_ char *after = NULL;
_cleanup_free_ char *wants = NULL;
"[%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,
+ "[%s:%u] Trailing garbage in Provides, ignoring.",
+ s->path, line);
} else if (startswith_no_case(t, "Required-Start:") ||
startswith_no_case(t, "Should-Start:") ||
"[%s:%u] Failed to add dependency on %s, ignoring: %s",
s->path, line, m, strerror(-r));
}
+ if (!isempty(state_))
+ log_error_unit(s->name,
+ "[%s:%u] Trailing garbage in %*s, ignoring.",
+ s->path, line,
+ (int)(strchr(t, ':') - t), t);
} else if (startswith_no_case(t, "Description:")) {
char *d, *j;
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;
}
MAX(a*10 + b, service->sysv_start_priority);
}
- r = set_ensure_allocated(&runlevel_services[i],
- trivial_hash_func, trivial_compare_func);
+ r = set_ensure_allocated(&runlevel_services[i], NULL);
if (r < 0)
goto finish;
} else if (de->d_name[0] == 'K' &&
(rcnd_table[i].type == RUNLEVEL_DOWN)) {
- r = set_ensure_allocated(&shutdown_services,
- trivial_hash_func, trivial_compare_func);
+ r = set_ensure_allocated(&shutdown_services, NULL);
if (r < 0)
goto finish;
return EXIT_FAILURE;
}
- all_services = hashmap_new(string_hash_func, string_compare_func);
+ all_services = hashmap_new(&string_hash_ops);
if (!all_services) {
log_oom();
return EXIT_FAILURE;