1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

Allow addresses to be specified for --listen-... args

Hostnames still aren't accepted.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-06-30 01:11:32 -04:00
parent d3b7fd541b
commit 24739b7b75

View File

@ -698,10 +698,7 @@ static int fd_fd(const char *spec) {
if (r < 0)
return r;
if (fd >= 0)
return -ENOENT;
return -fd;
return -1;
}
@ -1118,14 +1115,8 @@ static int parse_argv(int argc, char *argv[]) {
r = fd_fd(optarg);
if (r >= 0)
http_socket = r;
else if (r == -ENOENT)
else
arg_listen_http = optarg;
else {
log_error("Invalid port/fd specification %s: %s",
optarg, strerror(-r));
return -EINVAL;
}
break;
case ARG_LISTEN_HTTPS:
@ -1137,13 +1128,8 @@ static int parse_argv(int argc, char *argv[]) {
r = fd_fd(optarg);
if (r >= 0)
https_socket = r;
else if (r == -ENOENT)
else
arg_listen_https = optarg;
else {
log_error("Invalid port/fd specification %s: %s",
optarg, strerror(-r));
return -EINVAL;
}
break;