Re: [PATCH] t5570: forward git-daemon messages in a different way

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

 



Am 4/19/2012 8:03, schrieb Jeff King:
> mkfifo fd
> yes >fd &
> pid=$!
> {
>         read line
>         echo $line
>         cat <fd &
> } <fd
> sleep 1
> kill $pid
> wait $pid
> rm -f fd
...
> Hmm. Yeah, if you strace the cat, it gets an immediate EOF. And even
> weirder, I notice this in the strace output:
> 
>   clone(...)
>   close(0)                                = 0
>   open("/dev/null", O_RDONLY)             = 0
>   ...
>   execve("/bin/cat", ["cat"], [/* 50 vars */]) = 0
> 
> What? The shell is literally redirecting the cat process's stdin from
> /dev/null. I'm totally confused.

You don't have to be; it's mandated by POSIX:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02

-- Hannes
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]