mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-05 14:57:11 +00:00
use close, not shutdown on BSD/Mac
This commit is contained in:
@@ -41,9 +41,10 @@ pub fn deinit(self: *TestHTTPServer) void {
|
|||||||
pub fn stop(self: *TestHTTPServer) void {
|
pub fn stop(self: *TestHTTPServer) void {
|
||||||
self.shutdown.store(true, .release);
|
self.shutdown.store(true, .release);
|
||||||
if (self.listener) |*listener| {
|
if (self.listener) |*listener| {
|
||||||
// Use shutdown to unblock accept(). On Linux this causes accept to
|
switch (@import("builtin").target.os.tag) {
|
||||||
// return error.SocketNotListening. close() alone doesn't interrupt accept().
|
.linux => std.posix.shutdown(listener.stream.handle, .recv) catch {},
|
||||||
std.posix.shutdown(listener.stream.handle, .recv) catch {};
|
else => std.posix.close(listener.stream.handle),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user