diff options
author | Colin Ihrig <cjihrig@gmail.com> | 2022-07-12 11:53:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 11:53:53 -0400 |
commit | dcd05d4cb9780b7ab6753de5267bc59d834d8022 (patch) | |
tree | 5e426dafdb46e01ca0dc14c5206164ab547973d5 /ext/net/ops_unix.rs | |
parent | 2ff3e8a6c523633fca9d5a44599ddf22dfa4e961 (diff) |
fix(net): don't panic on failed UDS removal (#15157)
If a Unix Domain Socket cannot be removed, throw instead of
panicing.
Fixes: https://github.com/denoland/deno/issues/14213
Diffstat (limited to 'ext/net/ops_unix.rs')
-rw-r--r-- | ext/net/ops_unix.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/net/ops_unix.rs b/ext/net/ops_unix.rs index 4f03ecb0a..c47102400 100644 --- a/ext/net/ops_unix.rs +++ b/ext/net/ops_unix.rs @@ -144,7 +144,7 @@ pub fn listen_unix( addr: &Path, ) -> Result<(u32, tokio::net::unix::SocketAddr), AnyError> { if addr.exists() { - remove_file(&addr).unwrap(); + remove_file(&addr)?; } let listener = UnixListener::bind(&addr)?; let local_addr = listener.local_addr()?; @@ -162,7 +162,7 @@ pub fn listen_unix_packet( addr: &Path, ) -> Result<(u32, tokio::net::unix::SocketAddr), AnyError> { if addr.exists() { - remove_file(&addr).unwrap(); + remove_file(&addr)?; } let socket = UnixDatagram::bind(&addr)?; let local_addr = socket.local_addr()?; |