Fix random errors for piped input on macos #3953
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the random errors around piped input, mainly on macos but in theory also possible on other unix systems. When we canonicalize a path to find out if we can treat input from
Stdin
as fifo (we get a resulting path here) or pipe, (we don't) then it may happen sometimes that the canonicalized path points to/dev/fd/0
. We should treat this result like a pipe.A different solution also may have been to remove the guards from the is_tailable() method, but I've found putting the solution into the
resolve()
method being more explicit. Theis_tailable()
method should be refactored anyways also because of @niyaznigmatullin comment here #3919 (comment)Fixes #3958, #3916