]> Zhao Yanbai Git Server - minix.git/commitdiff
devman: initialize libvtreefs hooks
authorBen Gras <ben@minix3.org>
Fri, 31 Aug 2012 16:32:17 +0000 (18:32 +0200)
committerBen Gras <ben@minix3.org>
Fri, 31 Aug 2012 17:12:49 +0000 (19:12 +0200)
. uninitialized cleanup hook was causing devman crashes
  on reboot, calling uninitialized cleanup hook whenever it
  didn't happen to be 0

servers/devman/main.c

index 98bc45e5c1635c7c2ac7655e6fc541cc57f69d18..2cb77b6fc3f6b8f258850a18df0464cc82ab9f20 100644 (file)
@@ -77,12 +77,10 @@ int main (int argc, char* argv[])
        struct inode_stat root_stat;
 
        /* fill in the hooks */
-       hooks.init_hook         = &init_hook;
-       hooks.lookup_hook       = NULL;                         /* use the default behavior of lookup */
-       hooks.getdents_hook = NULL;                             /* use the default behavior of getdents */
-       hooks.read_hook         = read_hook;                            /* read hook will never be called */
-       hooks.rdlink_hook       = NULL;                         /* there are no symbolic links in devfs */
-       hooks.message_hook      = message_hook;         /* handle the ds_update call */
+       memset(&hooks, 0, sizeof(hooks));
+       hooks.init_hook         = init_hook;
+       hooks.read_hook         = read_hook; /* read will never be called */
+       hooks.message_hook      = message_hook; /* handle the ds_update call */
 
        root_stat.mode  = S_IFDIR | S_IRUSR | S_IRGRP | S_IROTH;
        root_stat.uid   = 0;