1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

/ is no longer a valid filename under ramfs.

This commit is contained in:
Jonas 'Sortie' Termansen 2011-11-22 15:33:47 +01:00
parent 2c3fb60d52
commit 8678ad6444

View file

@ -239,10 +239,14 @@ namespace Sortix
Device* DevRAMFS::Open(const char* path, int flags, mode_t mode) Device* DevRAMFS::Open(const char* path, int flags, mode_t mode)
{ {
if ( (flags & O_LOWERFLAGS) == O_SEARCH ) if ( path[0] == 0 || (path[0] == '/' && path[1] == 0) )
{ {
if ( path[0] == 0 || (path[0] == '/' && path[1] == 0) ) { return new DevRAMFSDir(this); } if ( (flags & O_LOWERFLAGS) == O_SEARCH )
Error::Set(Error::ENOTDIR); {
return new DevRAMFSDir(this);
}
Error::Set(Error::EISDIR);
return NULL; return NULL;
} }