Skip to content

Commit

Permalink
F_GETFD can't get O_NONBLOCK flag, use F_GETFL
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddance committed Jul 7, 2020
1 parent 2082845 commit cc46d60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions co_hook_sys_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,6 @@ int fcntl(int fildes, int cmd, ...)
case F_GETFD:
{
ret = g_sys_fcntl_func( fildes,cmd );
if (lp && !(lp->user_flag & O_NONBLOCK)) {
ret = ret & (~O_NONBLOCK);
}
break;
}
case F_SETFD:
Expand All @@ -686,6 +683,9 @@ int fcntl(int fildes, int cmd, ...)
case F_GETFL:
{
ret = g_sys_fcntl_func( fildes,cmd );
if (lp && !(lp->user_flag & O_NONBLOCK)) {
ret = ret & (~O_NONBLOCK);
}
break;
}
case F_SETFL:
Expand Down

0 comments on commit cc46d60

Please sign in to comment.