summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-21 18:08:17 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:29:50 +0200
commit2717c43bca6f920c4d3b0909c33bf3c1f76a70a9 (patch)
tree3611503472e8f793fb24a39d53e00e36c8fabb26 /main.c
parent80e439d146f661c416b7f42c4180b16aae7ac2f7 (diff)
New root files: version, uptime, stat
* rootdir.c, rootdir.h: New files. * main.c: Use rootdir_create_node. * Makefile: Add the rootdir module.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/main.c b/main.c
index 75e1cda..15ad60f 100644
--- a/main.c
+++ b/main.c
@@ -4,34 +4,23 @@
#include <argp.h>
#include <hurd/netfs.h>
#include "procfs.h"
-#include "procfs_file.h"
-#include "procfs_dir.h"
#include "proclist.h"
+#include "rootdir.h"
#include "dircat.h"
-static struct node *
-make_file (void *dir_hook, void *ent_hook)
-{
- return procfs_file_make_node (ent_hook, -1, NULL);
-}
-
error_t
root_make_node (struct node **np)
{
- static const struct procfs_dir_entry static_entries[] = {
- { "hello", make_file, "Hello, World!\n" },
- { "goodbye", make_file, "Goodbye, cruel World!\n" },
- };
/* We never have two root nodes alive simultaneously, so it's ok to
have this as static data. */
static struct node *root_dirs[3];
error_t err;
- root_dirs[0] = procfs_dir_make_node (static_entries, NULL, NULL);
- if (! root_dirs[0])
- return ENOMEM;
+ err = proclist_create_node (getproc (), &root_dirs[0]);
+ if (err)
+ return err;
- err = proclist_create_node (getproc (), &root_dirs[1]);
+ err = rootdir_create_node (&root_dirs[1]);
if (err)
{
netfs_nrele (root_dirs[0]);