get_descriptor() can now also safely be called with a descriptor less
than zero. Supports now up to 64 file descriptors (just in case). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4694 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -52,7 +52,7 @@ class Descriptor {
|
|||||||
int32 fRefCount;
|
int32 fRefCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MAX_VFS_DESCRIPTORS 32
|
#define MAX_VFS_DESCRIPTORS 64
|
||||||
|
|
||||||
list gBootDevices;
|
list gBootDevices;
|
||||||
list gPartitions;
|
list gPartitions;
|
||||||
@@ -364,7 +364,7 @@ mount_boot_file_systems()
|
|||||||
static Descriptor *
|
static Descriptor *
|
||||||
get_descriptor(int fd)
|
get_descriptor(int fd)
|
||||||
{
|
{
|
||||||
if (fd >= MAX_VFS_DESCRIPTORS)
|
if (fd < 0 || fd >= MAX_VFS_DESCRIPTORS)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return gDescriptors[fd];
|
return gDescriptors[fd];
|
||||||
|
|||||||
Reference in New Issue
Block a user