diff --git a/kernel/descriptor.cpp b/kernel/descriptor.cpp index 55a9b3db..6584c5f3 100644 --- a/kernel/descriptor.cpp +++ b/kernel/descriptor.cpp @@ -61,18 +61,18 @@ static const int OPEN_FLAGS = O_CREATE | O_DIRECTORY | O_EXCL | O_TRUNC | // Flags that only make sense for descriptors. static const int DESCRIPTOR_FLAGS = O_APPEND | O_NONBLOCK; -bool LinkInodeInDir(ioctx_t* ctx, - Ref dir, - const char* name, - Ref inode) +int LinkInodeInDir(ioctx_t* ctx, + Ref dir, + const char* name, + Ref inode) { Ref vnode(new Vnode(inode, Ref(), 0, 0)); if ( !vnode ) - return false; + return -1; Ref desc(new Descriptor(Ref(vnode), 0)); if ( !desc ) - return false; - return dir->link(ctx, name, desc) != 0; + return -1; + return dir->link(ctx, name, desc); } Ref OpenDirContainingPath(ioctx_t* ctx, diff --git a/kernel/include/sortix/kernel/descriptor.h b/kernel/include/sortix/kernel/descriptor.h index 96678092..0ae96ada 100644 --- a/kernel/include/sortix/kernel/descriptor.h +++ b/kernel/include/sortix/kernel/descriptor.h @@ -132,8 +132,8 @@ private: }; -bool LinkInodeInDir(ioctx_t* ctx, Ref dir, const char* name, - Ref inode); +int LinkInodeInDir(ioctx_t* ctx, Ref dir, const char* name, + Ref inode); Ref OpenDirContainingPath(ioctx_t* ctx, Ref from, const char* path, char** finalp);