summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorMoritz Schulte <moritz@duesseldorf.ccc.de>2002-10-19 12:04:42 +0000
committerMoritz Schulte <moritz@duesseldorf.ccc.de>2002-10-19 12:04:42 +0000
commitff0f5a422aae574c864c38b10185258192a230b2 (patch)
tree46bd0b9f90b973e92d3473cffd63b5938352fdd4 /node.c
parent79c2c62389a1b99cb301391834ef807b57ea57ee (diff)
2002-10-19 Moritz Schulte <moritz@duesseldorf.ccc.de>
* netio.h (NETIO_VERSION): Set to "0.2". 2002-10-19 Moritz Schulte <moritz@duesseldorf.ccc.de> * main.c (main): Initialize stat_default. * node.c: New variable: struct stat stat_default. (node_make_new): Initialize (*node)->nn_stat with stat_default. * node.c (node_make_protocol_node): Remove unnecessary nn_stat initialization. (node_make_host_node): Likewise. (node_make_port_node): Likewise. * main.c: New variable: int fsid ... (main): ... initialized with getpid (). 2002-10-16 Moritz Schulte <moritz@duesseldorf.ccc.de> * main.c: (main): Set netfs_root_node->nn_stat.st_fsid after netfs_root_node->nn_stat is initialized. * Makefile (CFLAGS): Added -D_FILE_OFFSET_BITS=64.
Diffstat (limited to 'node.c')
-rw-r--r--node.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/node.c b/node.c
index 29529103a..0524d5d43 100644
--- a/node.c
+++ b/node.c
@@ -24,6 +24,9 @@
#include "netio.h"
#include "lib.h"
+/* The default stat information for netio nodes. */
+struct stat stat_default;
+
/* Create a new node in the directory *DIR (if DIR is nonzero) and
store it in *NODE. If CONNECT is true (in which case *DIR has to
be a valid directory node), attach the new node to the list of
@@ -52,6 +55,8 @@ node_make_new (struct node *dir, int connect, struct node **node)
(*node)->nn->connected = 0;
(*node)->nn->entries = 0;
(*node)->nn->dir = dir;
+ (*node)->nn_stat = stat_default;
+
if (dir)
netfs_nref (dir);
@@ -116,12 +121,7 @@ node_make_protocol_node (struct node *dir, struct protocol *protocol)
| S_IRGRP | S_IXGRP
| S_IROTH | S_IXOTH;
node->nn_stat.st_ino = protocol->id;
- node->nn_stat.st_dev = netfs_root_node->nn_stat.st_dev;
- node->nn_stat.st_uid = netfs_root_node->nn_stat.st_uid;
- node->nn_stat.st_gid = netfs_root_node->nn_stat.st_gid;
- node->nn_stat.st_size = 0; /* ? */
- node->nn_stat.st_blocks = 0;
- node->nn_stat.st_blksize = 0;
+ node->nn_stat.st_nlink = 2;
fshelp_touch (&node->nn_stat, TOUCH_ATIME | TOUCH_CTIME | TOUCH_MTIME,
netio_maptime);
return err;
@@ -148,13 +148,6 @@ node_make_host_node (struct iouser *user, struct node *dir, char *host,
np->nn->flags |= HOST_NODE;
np->nn->protocol = dir->nn->protocol;
np->nn_stat.st_mode = S_IFDIR | S_IRUSR | S_IXUSR ;
- np->nn_stat.st_ino = 1; /* ? */
- np->nn_stat.st_dev = netfs_root_node->nn_stat.st_dev;
- np->nn_stat.st_uid = *user->uids->ids;
- np->nn_stat.st_gid = *user->gids->ids;
- np->nn_stat.st_size = 0; /* ? */
- np->nn_stat.st_blocks = 0;
- np->nn_stat.st_blksize = 0;
fshelp_touch (&np->nn_stat, TOUCH_ATIME | TOUCH_CTIME | TOUCH_MTIME,
netio_maptime);
*node = np;
@@ -181,13 +174,6 @@ node_make_port_node (struct iouser *user, struct node *dir,
np->nn->flags |= HOST_NODE;
np->nn->protocol = dir->nn->protocol;
np->nn_stat.st_mode = S_IFSOCK | S_IRUSR | S_IWUSR ;
- np->nn_stat.st_ino = 1; /* ? */
- np->nn_stat.st_dev = netfs_root_node->nn_stat.st_dev;
- np->nn_stat.st_uid = *user->uids->ids;
- np->nn_stat.st_gid = *user->gids->ids;
- np->nn_stat.st_size = 0; /* ? */
- np->nn_stat.st_blocks = 0;
- np->nn_stat.st_blksize = 0;
fshelp_touch (&np->nn_stat, TOUCH_ATIME | TOUCH_CTIME | TOUCH_MTIME,
netio_maptime);
*node = np;