This commit is contained in:
root
2026-06-15 15:40:24 +00:00
parent 5f430155b7
commit 5ee257565c
4 changed files with 79 additions and 38 deletions
+13 -2
View File
@@ -851,6 +851,12 @@ static int ws_broker_connect_unix(const String& path)
struct sockaddr_un addr;
memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
if(path.size() >= sizeof(addr.sun_path))
{
fprintf(stderr, "ws broker unix socket path too long: %s\n", path.c_str());
::close(fd);
return(-1);
}
strncpy(addr.sun_path, path.c_str(), sizeof(addr.sun_path) - 1);
if(::connect(fd, (struct sockaddr*)&addr, sizeof(addr)) < 0)
{
@@ -954,7 +960,7 @@ void ws_broker_drain_outbound()
ssize_t n = ::send(fd, pending.data(), pending.size(), MSG_NOSIGNAL | MSG_DONTWAIT);
if(n > 0)
pending.erase(0, n);
else if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK)
else if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
done = true;
}
if(!done && pending.empty())
@@ -963,7 +969,7 @@ void ws_broker_drain_outbound()
ssize_t r = ::recv(fd, buf, sizeof(buf), MSG_DONTWAIT);
if(r == 0)
done = true; // worker closed the connection: render complete
else if(r < 0 && errno != EAGAIN && errno != EWOULDBLOCK)
else if(r < 0 && errno != EAGAIN && errno != EWOULDBLOCK && errno != EINTR)
done = true;
}
if(done)
@@ -1279,6 +1285,11 @@ void ensure_proactive_compiler()
return;
pid_t p = fork();
if(p < 0)
{
perror("fork proactive compiler");
return;
}
if(p == 0)
{
file_release_process_locks("proactive compiler fork");