File 1100-gen-clarify-usage-of-self-as-parent-PID.patch of Package erlang
From e5b0f97ca57f7fa3d62e18b075d7b7cafb035a7a Mon Sep 17 00:00:00 2001
From: Mattias Hansson <hansson.mattias@gmail.com>
Date: Sat, 2 Jan 2021 12:51:37 +0100
Subject: [PATCH] gen: clarify usage of 'self' as parent PID
The atom `self` is used instead of parent PID for processes without a
parent, like in the case of monitor or link. The use of the atom `self`
could be mistaken for a typo.
This patch changes the atom declaration to use single quotes to clarify
the intended use of `'self'` as an atom and hopefully removes the
possibility that `'self'` is interpreted as a typo when read by a fellow
developer.
---
lib/stdlib/src/gen.erl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/stdlib/src/gen.erl b/lib/stdlib/src/gen.erl
index b2f2a0ff4e..a127720f4d 100644
--- a/lib/stdlib/src/gen.erl
+++ b/lib/stdlib/src/gen.erl
@@ -113,7 +113,7 @@ do_spawn(GenMod, monitor, Mod, Args, Options) ->
do_spawn(GenMod, _, Mod, Args, Options) ->
Time = timeout(Options),
proc_lib:start(?MODULE, init_it,
- [GenMod, self(), self, Mod, Args, Options],
+ [GenMod, self(), 'self', Mod, Args, Options],
Time,
spawn_opts(Options)).
@@ -133,7 +133,7 @@ do_spawn(GenMod, monitor, Name, Mod, Args, Options) ->
do_spawn(GenMod, _, Name, Mod, Args, Options) ->
Time = timeout(Options),
proc_lib:start(?MODULE, init_it,
- [GenMod, self(), self, Name, Mod, Args, Options],
+ [GenMod, self(), 'self', Name, Mod, Args, Options],
Time,
spawn_opts(Options)).
--
2.26.2