Re: another ancient bug in head(1)

2014-10-07 Thread Martin Natano
> Index: head.c > === > RCS file: /cvs/src/usr.bin/head/head.c,v > retrieving revision 1.17 > diff -u -p -r1.17 head.c > --- head.c7 Oct 2014 19:38:57 - 1.17 > +++ head.c7 Oct 2014 21:16:43 - > @@ -48,6 +48,7 @@ s

another ancient bug in head(1)

2014-10-07 Thread Ingo Schwarze
Hi, while we are talking about ancient bugs in head(1), here is another one: Without the patch: $ date | head /dev/null /dev/stdin ==> /dev/null <== ==> /dev/stdin <== $ Oops, where did stdin go? The reopen(3) function doesn't work here, it first closes stdin, an