chiark / gitweb /
Allow addresses to be specified for --listen-... args
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 30 Jun 2014 05:11:32 +0000 (01:11 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 16 Jul 2014 02:31:40 +0000 (22:31 -0400)
Hostnames still aren't accepted.

src/journal-remote/journal-remote.c

index 5b991e9..22f067a 100644 (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;