/ 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

@ -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;
} }