Modernization

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2014-10-12 11:21:12 -04:00
parent 4623e36006
commit b1389b0d08
2 changed files with 8 additions and 11 deletions
+6 -8
View File
@@ -288,7 +288,8 @@ int config_parse_socket_listen(const char *unit,
void *data,
void *userdata) {
SocketPort *p, *tail;
_cleanup_free_ SocketPort *p = NULL;
SocketPort *tail;
Socket *s;
int r;
@@ -315,10 +316,9 @@ int config_parse_socket_listen(const char *unit,
r = unit_full_printf(UNIT(s), rvalue, &p->path);
if (r < 0) {
p->path = strdup(rvalue);
if (!p->path) {
free(p);
if (!p->path)
return log_oom();
} else
else
log_syntax(unit, LOG_ERR, filename, line, -r,
"Failed to resolve unit specifiers on %s, ignoring: %s", rvalue, strerror(-r));
}
@@ -334,11 +334,10 @@ int config_parse_socket_listen(const char *unit,
log_syntax(unit, LOG_ERR, filename, line, -r,
"Failed to resolve unit specifiers on %s, ignoring: %s", rvalue, strerror(-r));
r = socket_address_parse_netlink(&p->address, k ? k : rvalue);
r = socket_address_parse_netlink(&p->address, k ?: rvalue);
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, -r,
"Failed to parse address value, ignoring: %s", rvalue);
free(p);
return 0;
}
@@ -355,7 +354,6 @@ int config_parse_socket_listen(const char *unit,
if (r < 0) {
log_syntax(unit, LOG_ERR, filename, line, -r,
"Failed to parse address value, ignoring: %s", rvalue);
free(p);
return 0;
}
@@ -371,7 +369,6 @@ int config_parse_socket_listen(const char *unit,
if (socket_address_family(&p->address) != AF_LOCAL && p->address.type == SOCK_SEQPACKET) {
log_syntax(unit, LOG_ERR, filename, line, ENOTSUP,
"Address family not supported, ignoring: %s", rvalue);
free(p);
return 0;
}
}
@@ -384,6 +381,7 @@ int config_parse_socket_listen(const char *unit,
LIST_INSERT_AFTER(port, s->ports, tail, p);
} else
LIST_PREPEND(port, s->ports, p);
p = NULL;
return 0;
}
+2 -3
View File
@@ -1475,9 +1475,8 @@ int server_init(Server *s) {
server_parse_config_file(s);
server_parse_proc_cmdline(s);
if (!!s->rate_limit_interval ^ !!s->rate_limit_burst) {
log_debug("Setting both rate limit interval and burst from %llu,%u to 0,0",
(long long unsigned) s->rate_limit_interval,
s->rate_limit_burst);
log_debug("Setting both rate limit interval and burst from "USEC_FMT",%u to 0,0",
s->rate_limit_interval, s->rate_limit_burst);
s->rate_limit_interval = s->rate_limit_burst = 0;
}