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:
Karl Seguin authored and GitHub committed 2026-03-11 16:39:15 +08:00
commit 0971df4dfc
1 file changed
+7 -1
+7 -1
View File
@@ -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);