daemon/shell: refactor redirection of 0/1/2 from /dev/null
commit1d999ddd1daa6da2779d21b293ea9b275780bff8
authorThomas Rast <trast@inf.ethz.ch>
Tue, 16 Jul 2013 09:27:36 +0000 (16 11:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 17 Jul 2013 19:50:34 +0000 (17 12:50 -0700)
tree4c179cf554418c4acf3249a64b021225a5ec6361
parent62e91efafd2030b7dc33ac6450b4e9a316e6ecc6
daemon/shell: refactor redirection of 0/1/2 from /dev/null

Both daemon.c and shell.c contain logic to open FDs 0/1/2 from
/dev/null if they are not already open.  Move the function in daemon.c
to setup.c and use it in shell.c, too.

While there, remove a 'not' that inverted the meaning of the comment.
The point is indeed to *avoid* messing up.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
daemon.c
setup.c
shell.c