From 8207fb8d985f792d3b4608116f3584fca74e4f75 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 5 Sep 2017 15:14:40 -0500 Subject: [PATCH] libc: sync bind sock control file before continuing with listen Fix #2512 --- repos/libports/src/lib/libc/socket_fs_plugin.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/repos/libports/src/lib/libc/socket_fs_plugin.cc b/repos/libports/src/lib/libc/socket_fs_plugin.cc index 9b26266049..29c17bdea5 100644 --- a/repos/libports/src/lib/libc/socket_fs_plugin.cc +++ b/repos/libports/src/lib/libc/socket_fs_plugin.cc @@ -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; }