diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2014-03-28 17:28:16 +0100 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2014-03-28 17:28:37 +0100 |
commit | 1e1a8b00975dcf278c7987e3905c9147e23a1d02 (patch) | |
tree | 780288c7cec96782c5475b14826f38a9f5fd2f0b /src/main.c | |
parent | 8077c4b476d579744ca26ad5d7f8da08ac7d56a5 (diff) | |
download | rspamd-1e1a8b00975dcf278c7987e3905c9147e23a1d02.tar.gz rspamd-1e1a8b00975dcf278c7987e3905c9147e23a1d02.zip |
LISTEN_FDS specifies number of passed sockets, not the first available fd
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c index ba091a7f0..364e20950 100644 --- a/src/main.c +++ b/src/main.c @@ -564,7 +564,7 @@ systemd_get_socket (gint number, gint listen_type) if (e != NULL) { errno = 0; max = strtoul (e, &err, 10); - if ((e == NULL || *e == '\0') && max > number + sd_listen_fds_start) { + if ((e == NULL || *e == '\0') && max > number) { sock = number + sd_listen_fds_start; if (fstat (sock, &st) == -1) { return NULL; @@ -584,7 +584,7 @@ systemd_get_socket (gint number, gint listen_type) } result = g_list_prepend (result, GINT_TO_POINTER (sock)); } - else if (max <= number + sd_listen_fds_start) { + else if (max <= number) { errno = EOVERFLOW; } } |