mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-22 04:34:44 +00:00
Merge pull request #1782 from lightpanda-io/silence_shutdown_error_on_non_linux
Don't log SocketNotConnected when shutting down listener on non-Linux
This commit is contained in:
@@ -180,7 +180,13 @@ pub fn run(self: *Runtime) void {
|
||||
}
|
||||
|
||||
if (self.listener) |listener| {
|
||||
posix.shutdown(listener.socket, .both) catch |err| {
|
||||
posix.shutdown(listener.socket, .both) catch |err| blk: {
|
||||
if (err == error.SocketNotConnected and builtin.os.tag != .linux) {
|
||||
// This error is normal/expected on BSD/MacOS. We probably
|
||||
// shouldn't bother calling shutdown at all, but I guess this
|
||||
// is safer.
|
||||
break :blk;
|
||||
}
|
||||
lp.log.warn(.app, "listener shutdown", .{ .err = err });
|
||||
};
|
||||
posix.close(listener.socket);
|
||||
|
||||
Reference in New Issue
Block a user