X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fconf-parser.c;h=2148a30c66c1791e8dd233372a38d82b6d38736f;hb=322e94abd97bbd3b8b0d37719449c0be5b9d99d8;hp=f9a3459caa2ca65eacd7fc96f0c18fdfc481eb50;hpb=e2cc6eca73cd1df8be552d7c23f9ff3d69c06f1e;p=elogind.git diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index f9a3459ca..2148a30c6 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -22,9 +22,7 @@ #include #include #include -#include #include -#include #include "conf-parser.h" #include "conf-files.h" @@ -34,8 +32,6 @@ #include "log.h" #include "utf8.h" #include "path-util.h" -#include "set.h" -#include "exit-status.h" #include "sd-messages.h" int log_syntax_internal( @@ -61,7 +57,7 @@ int log_syntax_internal( if (unit) r = log_struct_internal(level, - error > 0 ? error : EINVAL, + error, file, line, func, getpid() == 1 ? "UNIT=%s" : "USER_UNIT=%s", unit, LOG_MESSAGE_ID(SD_MESSAGE_CONFIG_ERROR), @@ -71,7 +67,7 @@ int log_syntax_internal( NULL); else r = log_struct_internal(level, - error > 0 ? error : EINVAL, + error, file, line, func, LOG_MESSAGE_ID(SD_MESSAGE_CONFIG_ERROR), "CONFIG_FILE=%s", config_file, @@ -367,7 +363,7 @@ int config_parse(const char *unit, if (feof(f)) break; - log_error("Failed to read configuration file '%s': %m", filename); + log_error_errno(errno, "Failed to read configuration file '%s': %m", filename); return -errno; } @@ -428,8 +424,8 @@ int config_parse(const char *unit, if (r < 0) { if (warn) - log_warning("Failed to parse file '%s': %s", - filename, strerror(-r)); + log_warning_errno(r, "Failed to parse file '%s': %m", + filename); return r; } } @@ -823,8 +819,7 @@ int config_parse_log_facility( x = log_facility_unshifted_from_string(rvalue); if (x < 0) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Failed to parse log facility, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse log facility, ignoring: %s", rvalue); return 0; } @@ -855,8 +850,7 @@ int config_parse_log_level( x = log_level_from_string(rvalue); if (x < 0) { - log_syntax(unit, LOG_ERR, filename, line, EINVAL, - "Failed to parse log level, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, EINVAL, "Failed to parse log level, ignoring: %s", rvalue); return 0; }