mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
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
This commit is contained in:
parent
2ff3e8a6c5
commit
dcd05d4cb9
1 changed files with 2 additions and 2 deletions
|
@ -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()?;
|
||||
|
|
Loading…
Reference in a new issue