diff options
author | Thomas Bushnell <thomas@gnu.org> | 1996-08-07 19:03:53 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1996-08-07 19:03:53 +0000 |
commit | 19d0f00234b0884a31c8bd4b806c6d512baae9be (patch) | |
tree | b1fbd27e19126286009ba2486e1fc49886b8d8d7 /nfsd/fsys.c | |
parent | feecb48f23f7e3cff12f14a579a56b8b8143b275 (diff) | |
download | hurd-19d0f00234b0884a31c8bd4b806c6d512baae9be.tar.gz hurd-19d0f00234b0884a31c8bd4b806c6d512baae9be.tar.bz2 hurd-19d0f00234b0884a31c8bd4b806c6d512baae9be.zip |
*** empty log message ***
Diffstat (limited to 'nfsd/fsys.c')
-rw-r--r-- | nfsd/fsys.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/nfsd/fsys.c b/nfsd/fsys.c index d3c50220..97137455 100644 --- a/nfsd/fsys.c +++ b/nfsd/fsys.c @@ -49,10 +49,16 @@ init_filesystems (void) int line; file_t root; static FILE *index_file; + int i; fsystable = (struct fsys_spec *) malloc ((fsystablesize = 10) * sizeof (struct fsys_spec)); - + for (i = 0; i < fsystablesize; i++) + { + fsystable[i].fsys = MACH_PORT_NULL; + fsystable[i].name = 0; + } + if (!index_file_name) return; @@ -91,14 +97,22 @@ init_filesystems (void) } if (index >= fsystablesize) - fsystable = (struct fsys_spec *) realloc (fsystable, - (fsystablesize = index * 2) - * sizeof (struct fsys_spec)); - if (index > nfsys) - nfsys = index; + { + fsystable = (struct fsys_spec *) + realloc (fsystable, index * 2 * sizeof (struct fsys_spec)); + for (i = fsystablesize; i < index * 2; i++) + { + fsystable[i].fsys = MACH_PORT_NULL; + fsystable[i].name = 0; + } + fsystablesize = index * 2; + } + + if (index + 1 > nfsys) + nfsys = index + 1; fsystable[index].name = name; - file_getcontrol (root, &fsystable[nfsys].fsys); + file_getcontrol (root, &fsystable[index].fsys); mach_port_deallocate (mach_task_self (), root); } } @@ -176,9 +190,17 @@ enter_filesystem (char *name, file_t root) return i; if (nfsys == fsystablesize) - fsystable = (struct fsys_spec *) realloc (fsystable, - (fsystablesize *= 2) - * sizeof (struct fsys_spec)); + { + fsystable = (struct fsys_spec *) realloc (fsystable, + (fsystablesize * 2) + * sizeof (struct fsys_spec)); + for (i = fsystablesize; i < fsystablesize * 2; i++) + { + fsystable[i].fsys = MACH_PORT_NULL; + fsystable[i].name = 0; + } + fsystablesize *= 2; + } fsystable[nfsys].name = malloc (strlen (name) + 1); strcpy (fsystable[nfsys].name, name); |