[Toybox] [PATCH] setsid(1): call setsid(2) before setpgrp(2).

Yi-yo Chiang yochiang at google.com
Tue Apr 20 03:37:31 PDT 2021


Interesting. Probably because our previous for-loop takes input from
regular file. The GNU implementation seems to treat only special files
(block and char devices) differently as a "magnetic tape".

On Tue, Apr 20, 2021 at 5:33 PM Rob Landley <rob at landley.net> wrote:

> On 4/20/21 3:23 AM, Yi-yo Chiang via Toybox wrote:
> > Why do we need setsid in the new cpio testcase though?
>
> Because without it TEST_HOST=1 calls the gnu/dammit cpio which does:
>
>   $ cpio -i < /dev/null
>   Found end of tape.  To continue, type device/file name when ready.
>
> And then hangs waiting for you to hit enter after changing a nonexistent
> reel-to-reel magnetic tape. The setsid breaks the association with
> /dev/tty so
> opening it fails and thus cpio returns immediately.
>
> (I.E. I have no idea how your previous for loop working around the
> TRAILER!!!
> behavior ever worked. I'm guessing you never ran that script from a
> context with
> a controlling tty?)
>
> Rob
>


-- 

Yi-yo Chiang
Software Engineer
yochiang at google.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20210420/ed141591/attachment.htm>


More information about the Toybox mailing list