Skip to content

Commit

Permalink
mxshadowsrv: Fix error check for listen socket
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed May 20, 2021
1 parent 378566b commit 93815ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mxshadowsrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ int main(int argc, char **argv) {
if (SSL_CTX_use_certificate_file(ssl_ctx, cert_file, SSL_FILETYPE_PEM) <= 0) { psslerror("SSL_CTX_use_certificate_file"); return 1; }

int listen_socket = socket(AF_INET, SOCK_STREAM, 0);
if (listen_socket == 0) { perror("socket"); return 1; }
if (listen_socket == -1) { perror("socket"); return 1; }

static int true = 1;
int status = setsockopt(listen_socket, SOL_SOCKET, SO_REUSEADDR, &true, sizeof(true));
Expand Down

0 comments on commit 93815ec

Please sign in to comment.