libc: sync bind sock control file before continuing with listen

Fix #2512
This commit is contained in:
Emery Hemingway 2017-09-05 15:14:40 -05:00 committed by Christian Helmuth
parent a79378ff19
commit 8207fb8d98

View File

@ -502,6 +502,7 @@ extern "C" int socket_fs_bind(int libc_fd, sockaddr const *addr, socklen_t addrl
int const len = strlen(addr_string.base());
int const n = write(context->bind_fd(), addr_string.base(), len);
if (n != len) return Errno(EACCES);
fsync(context->bind_fd());
return 0;
}