From 12ca818ffddb77eb6a0fabe369a5bcbf6994ff8b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Sep 2015 18:22:42 +0200 Subject: tree-wide: clean up log_syntax() usage - Rely everywhere that we use abs() on the error code passed in anyway, thus don't need to explicitly negate what we pass in - Never attach synthetic error number information to log messages. Only log about errors we *receive* with the error number we got there, don't log any synthetic error, that don#t even propagate, but just eat up. - Be more careful with attaching exactly the error we get, instead of errno or unrelated errors randomly. - Fix one occasion where the error number and line number got swapped. - Make sure we never tape over OOM issues, or inability to resolve specifiers --- src/login/logind-user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/login') diff --git a/src/login/logind-user.c b/src/login/logind-user.c index 47669afdef..451954e860 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -868,12 +868,12 @@ int config_parse_tmpfs_size( errno = 0; ul = strtoul(rvalue, &f, 10); if (errno != 0 || f != e) { - log_syntax(unit, LOG_ERR, filename, line, errno ? errno : EINVAL, "Failed to parse percentage value, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, errno, "Failed to parse percentage value, ignoring: %s", rvalue); return 0; } if (ul <= 0 || ul >= 100) { - log_syntax(unit, LOG_ERR, filename, line, errno ? errno : EINVAL, "Percentage value out of range, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, 0, "Percentage value out of range, ignoring: %s", rvalue); return 0; } @@ -883,7 +883,7 @@ int config_parse_tmpfs_size( r = parse_size(rvalue, 1024, &k); if (r < 0 || (uint64_t) (size_t) k != k) { - log_syntax(unit, LOG_ERR, filename, line, r < 0 ? r : ERANGE, "Failed to parse size value, ignoring: %s", rvalue); + log_syntax(unit, LOG_ERR, filename, line, r, "Failed to parse size value, ignoring: %s", rvalue); return 0; } -- cgit v1.2.3-54-g00ecf