/ 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
1 changed files with 7 additions and 3 deletions

View File

@ -238,11 +238,15 @@ 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 ( path[0] == 0 || (path[0] == '/' && path[1] == 0) )
{ {
if ( (flags & O_LOWERFLAGS) == O_SEARCH ) if ( (flags & O_LOWERFLAGS) == O_SEARCH )
{ {
if ( path[0] == 0 || (path[0] == '/' && path[1] == 0) ) { return new DevRAMFSDir(this); } return new DevRAMFSDir(this);
Error::Set(Error::ENOTDIR); }
Error::Set(Error::EISDIR);
return NULL; return NULL;
} }