]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdmon.c
mdadm: Unify forks behaviour
[thirdparty/mdadm.git] / mdmon.c
diff --git a/mdmon.c b/mdmon.c
index ff985d291ee9045ede3daf68c1184af3ee0384eb..c71e62c6b35a7e4d3ed7751794a2b0674b41113f 100644 (file)
--- a/mdmon.c
+++ b/mdmon.c
@@ -546,14 +546,7 @@ static int mdmon(char *devnm, int must_fork, int takeover)
        }
 
        setsid();
-       close(0);
-       open("/dev/null", O_RDWR);
-       close(1);
-       ignore = dup(0);
-#ifndef DEBUG
-       close(2);
-       ignore = dup(0);
-#endif
+       manage_fork_fds(0);
 
        /* This silliness is to stop the compiler complaining
         * that we ignore 'ignore'