File 2090-kernel-Add-a-missing-raw-option-in-erl_uds_dist.patch of Package erlang
From 00583e2f7226c2064cdef0f943a208e21c93fd52 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20de=20Bretagne?=
<jerome.debretagne@gmail.com>
Date: Thu, 14 Oct 2021 22:21:26 +0200
Subject: [PATCH] kernel: Add a missing raw option in erl_uds_dist
---
lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl b/lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl
index 44035e8e42..c69947184f 100644
--- a/lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl
+++ b/lib/kernel/examples/erl_uds_dist/src/erl_uds_dist.erl
@@ -755,8 +755,10 @@ close(ListeningSocket) ->
%% Get the listening socket address in a {local, Pathname} format
{ok, SocketAddress} = inet:sockname(ListeningSocket),
{local, SocketPathname} = SocketAddress,
- %% Remove the socket file from the filesystem
- file:delete(SocketPathname),
+ %% Remove the socket file from the filesystem. The raw option is used
+ %% to bypass the need for a file server, which may not be available
+ %% and registered anymore (for instance during a node shutdown phase).
+ file:delete(SocketPathname, [raw]),
gen_tcp:close(ListeningSocket).
--
2.31.1