…
> +++ b/tools/testing/selftests/net/tfo.c
> @@ -82,8 +82,10 @@ static void run_server(void)
…
>       if (read(connfd, buf, 64) < 0)
> -             perror("read()");
> -     fprintf(outfile, "%d\n", opt);
> +             error(1, errno, "read()");
> +
> +     if (fprintf(outfile, "%d\n", opt) < 0)
> +             error(1, errno, "fprintf()");
>  
>       fclose(outfile);
>       close(connfd);
…

Why was error detection omitted for close() calls here so far?

https://pubs.opengroup.org/onlinepubs/9799919799/functions/fclose.html

Regards,
Markus

Reply via email to