[PATCH 1/3] scripts: Avoid spawning yet another process in meson-python.sh

Michal Privoznik posted 3 patches 2 years, 5 months ago
[PATCH 1/3] scripts: Avoid spawning yet another process in meson-python.sh
Posted by Michal Privoznik 2 years, 5 months ago
The aim of message-python.sh wrapper is to set some environment
variables and then execute whatever it was called with (usually a
python binary).

Well, we can use 'exec' to replace the shell process with python
instead of forking yet another process.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 scripts/meson-python.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/meson-python.sh b/scripts/meson-python.sh
index 9ba670fc1a..52b37be926 100755
--- a/scripts/meson-python.sh
+++ b/scripts/meson-python.sh
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 "$@"
+LC_ALL= LANG=C LC_CTYPE=en_US.UTF-8 exec "$@"
-- 
2.41.0
Re: [PATCH 1/3] scripts: Avoid spawning yet another process in meson-python.sh
Posted by Ján Tomko 2 years, 5 months ago
On a Tuesday in 2023, Michal Privoznik wrote:
>The aim of message-python.sh wrapper is to set some environment
>variables and then execute whatever it was called with (usually a
>python binary).
>
>Well, we can use 'exec' to replace the shell process with python
>instead of forking yet another process.
>
>Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>---
> scripts/meson-python.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano