From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 005FC469719 for ; Fri, 6 Mar 2020 17:30:49 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id f10so2413703ljn.6 for ; Fri, 06 Mar 2020 06:30:49 -0800 (PST) Date: Fri, 6 Mar 2020 17:30:47 +0300 From: Cyrill Gorcunov Message-ID: <20200306143047.GA27301@uranus> References: <20200302201227.31785-1-gorcunov@gmail.com> <20200302201227.31785-7-gorcunov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200302201227.31785-7-gorcunov@gmail.com> Subject: [Tarantool-patches] [PATCH v2 6/7] popen: handle setsid os specifics List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Due to os specifics we can't call setsid after vfork on macos (vfork is not longer a part of posix btw). Thus lets simply ignore it. If there gonna be a strong need to drop controlling terminal (we could use ioctl) or setup new group we will enhance it. But only if really needed. Signed-off-by: Cyrill Gorcunov --- I pushed the new series into gorcunov/gh-4031-popen-fixup-2 src/lib/core/popen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index 6e5ca21bd..40da05b52 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -833,9 +833,11 @@ popen_new(struct popen_opts *opts) if (opts->flags & POPEN_FLAG_RESTORE_SIGNALS) signal_reset(); +#ifndef TARGET_OS_DARWIN /* - * We have to be a session leader otherwise - * won't be able to kill a group of children. + * Note that on MacOS we're not allowed to + * set sid after vfork (it is OS specific) + * thus simply ignore this flag. */ if (opts->flags & POPEN_FLAG_SETSID) { if (setsid() == -1) { @@ -843,6 +845,7 @@ popen_new(struct popen_opts *opts) goto exit_child; } } +#endif if (opts->flags & POPEN_FLAG_CLOSE_FDS) { if (close_inherited_fds(skip_fds, nr_skip_fds)) { -- 2.20.1