]> Zhao Yanbai Git Server - minix.git/commitdiff
procfs: only initialize the first time procfs is mounte
authorDirk Vogt <dirk@minix3.org>
Tue, 22 Feb 2011 18:03:33 +0000 (18:03 +0000)
committerDirk Vogt <dirk@minix3.org>
Tue, 22 Feb 2011 18:03:33 +0000 (18:03 +0000)
servers/procfs/main.c

index fac11eafad6655b1e8c06998cb78ca229fcac4ec..193aa94bdf005061a8004c2739e6f3fac1f59979 100644 (file)
@@ -54,11 +54,16 @@ PRIVATE void init_hook(void)
 {
        /* Initialization hook. Generate the static part of the tree.
         */
+       static int first_time = 1;
        struct inode *root;
 
-       root = get_root_inode();
+       if (first_time) {
+               root = get_root_inode();
 
-       construct_tree(root, root_files);
+               construct_tree(root, root_files);
+
+               first_time = 0;
+       }
 }
 
 /*===========================================================================*