From 44d4807fc44225bcb56f0aefe23f0f549b2d3356 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Thu, 30 Jul 2015 01:17:36 +0200 Subject: [PATCH] Add ENOMOUNT. --- kernel/vnode.cpp | 2 +- libc/include/errno.h | 1 + libc/string/strerror.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/vnode.cpp b/kernel/vnode.cpp index ed0032f9..053482ca 100644 --- a/kernel/vnode.cpp +++ b/kernel/vnode.cpp @@ -187,7 +187,7 @@ int Vnode::unmount(ioctx_t* ctx, const char* filename, int flags) size_t mp_index; if ( !LookupMountUnlocked(normal_inode, &mp_index) ) - return errno = EINVAL, -1; + return errno = ENOMOUNT, -1; mountpoint_t* mp = mtable->mounts + mp_index; Ref mp_inode = mp->inode; diff --git a/libc/include/errno.h b/libc/include/errno.h index 5caea8b7..e128db83 100644 --- a/libc/include/errno.h +++ b/libc/include/errno.h @@ -118,6 +118,7 @@ extern "C" { #define EOWNERDEAD 96 #define EPROTO 97 #define ETXTBSY 98 +#define ENOMOUNT 99 #define EOPNOTSUPP ENOTSUP diff --git a/libc/string/strerror.cpp b/libc/string/strerror.cpp index d96d2431..b3e60cc1 100644 --- a/libc/string/strerror.cpp +++ b/libc/string/strerror.cpp @@ -117,6 +117,7 @@ extern "C" const char* sortix_strerror(int errnum) case EOWNERDEAD: return "Previous owner died"; case EPROTO: return "Protocol error"; case ETXTBSY: return "Text file busy"; + case ENOMOUNT: return "No such mountpoint"; default: return "Unknown error condition"; } }