Skip to content

Commit

Permalink
Default to marking file descriptors as passive sockets if fstat() doe…
Browse files Browse the repository at this point in the history
…sn't hint at the type Closes mheily#97
  • Loading branch information
arr2036 authored and ghostmansd committed Apr 28, 2021
1 parent 5af73d1 commit baafc74
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/linux/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,12 @@ linux_get_descriptor_type(struct knote *kn)
case S_IFSOCK:
dbg_printf("fd=%i is a socket", fd);
break; /* deferred type determination */

case 0: /* seen with eventfd */
dbg_printf("fd=%i fstat() provided no S_IFMT flags, treating fd as passive socket", fd);
kn->kn_flags |= KNFL_SOCKET;
kn->kn_flags |= KNFL_SOCKET_PASSIVE;
return (0);
}

/*
Expand Down

0 comments on commit baafc74

Please sign in to comment.