Skip to content

Commit

Permalink
[LibOS] Initialize socket handles to be readable and writable
Browse files Browse the repository at this point in the history
Signed-off-by: Borys Popławski <borysp@invisiblethingslab.com>
  • Loading branch information
boryspoplawski committed Apr 6, 2022
1 parent c56a353 commit cdbe494
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions LibOS/shim/src/sys/shim_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ long shim_do_socket(int family, int type, int protocol) {
hdl->type = TYPE_SOCK;
hdl->fs = &socket_builtin_fs;
hdl->flags = type & SOCK_NONBLOCK ? O_NONBLOCK : 0;
hdl->acc_mode = 0;
hdl->acc_mode = MAY_READ | MAY_WRITE;

struct shim_sock_handle* sock = &hdl->info.sock;
sock->domain = family;
Expand All @@ -93,9 +93,7 @@ long shim_do_socket(int family, int type, int protocol) {

switch (sock->sock_type) {
case SOCK_STREAM: // TCP
break;
case SOCK_DGRAM: // UDP
hdl->acc_mode = MAY_READ | MAY_WRITE;
break;

default:
Expand Down

0 comments on commit cdbe494

Please sign in to comment.