Skip to content

Commit

Permalink
Merge pull request #546 from h2o/kazuho/pr543
Browse files Browse the repository at this point in the history
error exit if O_NONBLOCK fails, as cli would probably not work
  • Loading branch information
kazuho authored Nov 3, 2024
2 parents 9b88159 + 787bfd9 commit 0fcd8c4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion t/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ static int handle_connection(int sockfd, ptls_context_t *ctx, const char *server
ptls_buffer_init(&encbuf, "", 0);
ptls_buffer_init(&ptbuf, "", 0);

fcntl(sockfd, F_SETFL, O_NONBLOCK);
if (fcntl(sockfd, F_SETFL, O_NONBLOCK) == -1) {
perror("fcntl");
goto Exit;
}

if (input_file == input_file_is_benchmark) {
if (!ptls_is_server(tls))
Expand Down

0 comments on commit 0fcd8c4

Please sign in to comment.