Quick fix for a crashing bug I just introduced.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15951 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
9c23fc9631
commit
60e5ea42e0
@ -201,12 +201,13 @@ get_fd(struct io_context *context, int fd)
|
||||
if ((uint32)fd < context->table_size)
|
||||
descriptor = context->fds[fd];
|
||||
|
||||
// Disconnected descriptors cannot be accessed anymore
|
||||
if (descriptor->open_mode & O_DISCONNECTED)
|
||||
descriptor = NULL;
|
||||
|
||||
if (descriptor != NULL) // fd is valid
|
||||
atomic_add(&descriptor->ref_count, 1);
|
||||
if (descriptor != NULL) {
|
||||
// Disconnected descriptors cannot be accessed anymore
|
||||
if (descriptor->open_mode & O_DISCONNECTED)
|
||||
descriptor = NULL;
|
||||
else
|
||||
atomic_add(&descriptor->ref_count, 1);
|
||||
}
|
||||
|
||||
mutex_unlock(&context->io_mutex);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user