From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3.mail.ru (smtp3.mail.ru [94.100.179.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 890154696C6 for ; Tue, 14 Apr 2020 14:38:43 +0300 (MSK) From: Alexander Turenko Date: Tue, 14 Apr 2020 14:38:12 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 03/12] popen: log a reason of close inherited fds failure List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org This information may be useful for debuggging. Part of #4031 --- src/lib/core/popen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index 30be74a5f..fddcbae8f 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -652,6 +652,8 @@ make_pipe(int pfd[2]) * * @a skip_fds is an array of @a nr_skip_fds elements * with descriptors which should be kept opened. + * + * Returns 0 at success, otherwise -1 and set a diag. */ static int close_inherited_fds(int *skip_fds, size_t nr_skip_fds) @@ -1030,7 +1032,8 @@ popen_new(struct popen_opts *opts) } if (opts->flags & POPEN_FLAG_CLOSE_FDS) { - if (close_inherited_fds(skip_fds, nr_skip_fds)) { + if (close_inherited_fds(skip_fds, nr_skip_fds) != 0) { + diag_log(); say_syserror("child: close inherited fds"); goto exit_child; } -- 2.25.0