diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_mount.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 53df6a2..3b1fcc5 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -72,7 +72,7 @@ vfs_create_mp(const char *path, int mntflags, struct mount **mp_out) int vfs_mount(const char *path, int mntflags) { - size_t hash = vfs_hash_path(path); + size_t hash; int status; struct mountlist_entry *entry; struct mount *mp; @@ -80,7 +80,7 @@ vfs_mount(const char *path, int mntflags) if ((status = vfs_create_mp(path, mntflags, &mp)) != 0) { return status; } - if (hash == 0) { + if (hash == -1) { /* Something is wrong with the path */ return -EINVAL; } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index ac8a16b..64dd7c9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -62,19 +62,19 @@ vfs_hash(const char *data) * * @path: Path to hash. * - * Returns 0 on failure, non-zero return values + * Returns -1 on failure, >= 0 return values * are valid. */ -size_t +ssize_t vfs_hash_path(const char *path) { char *name = NULL; size_t i = 0, hash = 0; if (strcmp(path, "/") == 0 || !vfs_is_valid_path(path)) { - return 0; + return -1; } else if (*path != '/') { - return 0; + return -1; } do { |