mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fixed error codes in sortix/fs/devfs.
This commit is contained in:
parent
245e8bf0e3
commit
6e536ba8f9
1 changed files with 5 additions and 4 deletions
|
@ -285,11 +285,12 @@ namespace Sortix
|
||||||
|
|
||||||
Device* DevDevFS::Open(const char* path, int flags, mode_t mode)
|
Device* DevDevFS::Open(const char* path, int flags, mode_t mode)
|
||||||
{
|
{
|
||||||
if ( (flags & O_LOWERFLAGS) == O_SEARCH )
|
int lowerflags = flags & O_LOWERFLAGS;
|
||||||
|
|
||||||
|
if ( !path[0] || (path[0] == '/' && !path[1]) )
|
||||||
{
|
{
|
||||||
if ( path[0] == 0 || (path[0] == '/' && path[1] == 0) ) { return new DevDevFSDir(); }
|
if ( lowerflags != O_SEARCH ) { Error::Set(EISDIR); return NULL; }
|
||||||
Error::Set(ENOTDIR);
|
return new DevDevFSDir();
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( String::Compare(path, "/null") == 0 ) { return new DevNull; }
|
if ( String::Compare(path, "/null") == 0 ) { return new DevNull; }
|
||||||
|
|
Loading…
Add table
Reference in a new issue