unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58117: [PATCH] [SV 63111] Set osync handle to noinherit
@ 2022-09-27 14:23 Andreas Schwab
  0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2022-09-27 14:23 UTC (permalink / raw)
  To: 58117

* 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."





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-27 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 14:23 bug#58117: [PATCH] [SV 63111] Set osync handle to noinherit Andreas Schwab

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).