From 1d999ddd1daa6da2779d21b293ea9b275780bff8 Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Tue, 16 Jul 2013 11:27:36 +0200 Subject: 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 Signed-off-by: Junio C Hamano --- cache.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 3622e1841..91974710c 100644 --- a/cache.h +++ b/cache.h @@ -400,6 +400,8 @@ extern int path_inside_repo(const char *prefix, const char *path); extern int set_git_dir_init(const char *git_dir, const char *real_git_dir, int); extern int init_db(const char *template_dir, unsigned int flags); +extern void sanitize_stdfds(void); + #define alloc_nr(x) (((x)+16)*3/2) /* -- cgit v1.2.1