bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] [SV 63111] Set osync handle to noinherit


From: Andreas Schwab
Subject: [PATCH] [SV 63111] Set osync handle to noinherit
Date: Tue, 27 Sep 2022 16:32:50 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

* src/posixos.c (osync_setup, osync_parse_mutex): Set osync_handle
to noinherit.
---
 src/posixos.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/posixos.c b/src/posixos.c
index d587f9c8..4097ce15 100644
--- a/src/posixos.c
+++ b/src/posixos.c
@@ -628,7 +628,10 @@ osync_setup ()
 {
   osync_handle = get_tmpfd (&osync_tmpfile);
   if (osync_handle >= 0)
-    sync_parent = 1;
+    {
+      fd_noinherit (osync_handle);
+      sync_parent = 1;
+    }
 }
 
 char *
@@ -662,6 +665,8 @@ osync_parse_mutex (const char *mutex)
     OSS (fatal, NILF, _("cannot open output sync mutex %s: %s"),
          osync_tmpfile, strerror (errno));
 
+  fd_noinherit (osync_handle);
+
   return 1;
 }
 
-- 
2.37.3


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]