diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2015-01-09 21:50:19 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2015-01-09 21:50:19 +0200 |
commit | a9b45badfec0928d20a27c7176c005fa637f7d1e (patch) | |
tree | c6b3bbb4bb25ce92af902176bd1e420ccce27c31 /src/xz | |
parent | Update THANKS. (diff) | |
download | xz-a9b45badfec0928d20a27c7176c005fa637f7d1e.tar.xz |
xz: Fix comments.
Diffstat (limited to 'src/xz')
-rw-r--r-- | src/xz/file_io.c | 12 |
1 files 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. |