From 787bfd9446dcab212b4674214af7a391840563d9 Mon Sep 17 00:00:00 2001 From: Frederik Deweerdt Date: Sat, 2 Nov 2024 13:15:47 +0000 Subject: [PATCH] error exit if O_NONBLOCK fails, as cli would probably not work --- t/cli.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/cli.c b/t/cli.c index c1e3fac4..ea56ea26 100644 --- a/t/cli.c +++ b/t/cli.c @@ -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))