X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal-remote%2Fjournal-remote.c;h=36c8e00e6b12b951f2697c95852cb349de4b6462;hb=d7bf74d9cccdc6ffa567ea0e08f814863610f88e;hp=1df178691a45c742e0d4111c890fd98a7da6d18d;hpb=799a8f39d8eb9ea725e85a598c0f5dbd658c8ba7;p=elogind.git diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index 1df178691..36c8e00e6 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; @@ -1370,8 +1370,7 @@ static int parse_argv(int argc, char *argv[]) { return -EINVAL; default: - log_error("Unknown option code %c", c); - return -EINVAL; + assert_not_reached("Unknown option code."); } if (optind < argc)