summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-11 18:24:43 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-11 18:24:43 +0200
commitd7bf74d9cccdc6ffa567ea0e08f814863610f88e (patch)
treeae58552cdd1ee803aff087ba3901db45245a703b
parentfd006cce3861ce8321149dfd9210d65639e5e1dc (diff)
journal-remote: fix parsing of fd command line argument
-rw-r--r--src/journal-remote/journal-remote.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index c8e3c235ac..36c8e00e6b 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -795,11 +795,12 @@ static int fd_fd(const char *spec) {
r = safe_atoi(spec, &fd);
if (r < 0)
return r;
+ if (fd < 0)
+ return -EINVAL;
- return -1;
+ return fd;
}
-
static int remoteserver_init(RemoteServer *s,
const char* key,
const char* cert,
@@ -809,7 +810,6 @@ static int remoteserver_init(RemoteServer *s,
assert(s);
-
if ((arg_listen_raw || arg_listen_http) && trust) {
log_error("Option --trust makes all non-HTTPS connections untrusted.");
return -EINVAL;