🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@nikic
Copy link
Member

@nikic nikic commented Sep 5, 2019

There are two related changes here:

  1. Also check for S_ISCHR when checking for pipes on Linux and FILE_TYPE_CHAR on Windows, otherwise we will not detect attached character devices, which have pipe-like behavior.
  2. Always set position=-1 (i.e. ftell will return false) when a pipe
    is detected. Previously position=0 was sometimes used, depending on
    whether we're on Windows/Linux and whether the FD or FILE codepath
    was used.

There are two related changes here:
1. Also check for S_ISCHR when checking for pipes on linux, otherwise
   we will not detect ttys.
2. Always set position=-1 (i.e. ftell will return false) when a pipe
   is detected. Previously position=0 was sometimes used, depending on
   whether we're on Windows/Linux and whether the FD or FILE codepath
   was used.
@nikic nikic changed the title Don't set position=0 on ESPIPE Fix pipe detection and stream position handling Sep 5, 2019
@nikic
Copy link
Member Author

nikic commented Sep 5, 2019

Merged as 9ec61e4.

Some more changes will be needed to handle closed std streams correctly (or at least, more correctly than right now).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant