coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tee: Add --pipe-check to allow instantly detecting closed ou


From: Arsen Arsenović
Subject: Re: [PATCH] tee: Add --pipe-check to allow instantly detecting closed outputs
Date: Sun, 27 Nov 2022 12:32:18 +0100

Arsen Arsenović <arsen@aarsen.me> writes:

> Looking at ``check_output_alive'', this logic should be fairly easy to
> reuse.  Worst case, I'd need to refactor some of the code to handle the
> non-pipe-check case more elegantly so that it doesn't become too
> unreadable when also adding the logic to pick between poll and select.

Got some free time again.  The more I think about how to do this, the
more it feels like the solution involves a portable poll or poll-like
function that gets translated to select() if need be on a given
platform, which sounds an awful lot like Gnulib ;).  The
``check_output_alive'' code checks for Gnulib poll and declares it
incompatible, but I can't quite tell what incompatibility this is.  I
wonder if that can be fixed?

If not, I can make factor out the check_alive logic and have it also
check for file descriptors with input data.  Sadly, I don't have many
non-GNU and non-Linux systems to test for poll behavior on; just some
(modern) Solaris and BSD VMs.

Thanks in advance, have a lovely day.
-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]