Skip to content

Commit

Permalink
Merge branch 'fix-390-selectfd_nullptr' into fix-377-select_ut
Browse files Browse the repository at this point in the history
  • Loading branch information
CDKnightNASA committed Mar 26, 2020
2 parents 09427b3 + 6a59242 commit ec23ff6
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/os/shared/osapi-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,18 @@ int32 OS_SelectSingle(uint32 objid, uint32 *StateFlags, int32 msecs)
uint32 local_id;
OS_common_record_t *record;

return_code = OS_ObjectIdGetById(OS_LOCK_MODE_REFCOUNT, OS_OBJECT_TYPE_OS_STREAM, objid, &local_id, &record);
if (return_code == OS_SUCCESS)
if(StateFlags == NULL)
{
return_code = OS_SelectSingle_Impl(local_id, StateFlags, msecs);
OS_ObjectIdRefcountDecr(record);
return_code = OS_INVALID_POINTER;
}
else
{
return_code = OS_ObjectIdGetById(OS_LOCK_MODE_REFCOUNT, OS_OBJECT_TYPE_OS_STREAM, objid, &local_id, &record);
if (return_code == OS_SUCCESS)
{
return_code = OS_SelectSingle_Impl(local_id, StateFlags, msecs);
OS_ObjectIdRefcountDecr(record);
}
}

return return_code;
Expand Down

0 comments on commit ec23ff6

Please sign in to comment.