From a9b45badfec0928d20a27c7176c005fa637f7d1e Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Fri, 9 Jan 2015 21:50:19 +0200 Subject: [PATCH] xz: Fix comments. --- src/xz/file_io.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/xz/file_io.c b/src/xz/file_io.c index 7895ee01..c52656c1 100644 --- a/src/xz/file_io.c +++ b/src/xz/file_io.c @@ -393,10 +393,11 @@ io_open_src_real(file_pair *pair) #ifdef TUKLIB_DOSLIKE setmode(STDIN_FILENO, O_BINARY); #else - // Try to set stdout to non-blocking mode. It won't work + // Try to set stdin to non-blocking mode. It won't work // e.g. on OpenBSD if stdout is e.g. /dev/null. In such - // case we proceed as if stdout were non-blocking anyway - // (in case of /dev/null it will be in practice). + // case we proceed as if stdin were non-blocking anyway + // (in case of /dev/null it will be in practice). The + // same applies to stdout in io_open_dest_real(). stdin_flags = fcntl(STDIN_FILENO, F_GETFL); if (stdin_flags == -1) { message_error(_("Error getting the file status flags " @@ -701,7 +702,10 @@ io_open_dest_real(file_pair *pair) #ifdef TUKLIB_DOSLIKE setmode(STDOUT_FILENO, O_BINARY); #else - // Set O_NONBLOCK if it isn't already set. + // Try to set O_NONBLOCK if it isn't already set. + // If it fails, we assume that stdout is non-blocking + // in practice. See the comments in io_open_src_real() + // for similar situation with stdin. // // NOTE: O_APPEND may be unset later in this function // and it relies on stdout_flags being set here.