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 37B5E4696CD for ; Tue, 14 Apr 2020 14:39:03 +0300 (MSK) From: Alexander Turenko Date: Tue, 14 Apr 2020 14:38:20 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 11/12] popen: clarify popen_read_timeout error message List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Popen backend errors should be meaningful for a user of the popen Lua API, because otherwise we'll need to map backend errors into Lua API errors. This particular failure can't appear when the function is called from the Lua API, but it is good to keep all error messages in one style. Part of #4031 --- src/lib/core/popen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index 36cd7b07d..640dffc2b 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -360,7 +360,7 @@ popen_write_timeout(struct popen_handle *handle, const void *buf, * * - IllegalParams: a parameter check fails: * - count: buffer is too big. - * - flags: POPEN_FLAG_FD_STD{OUT,ERR} are set or unset both. + * - flags: stdout and stdrr are both choosen or both missed * - handle: handle does not support the requested IO operation. * - SocketError: an IO error occurs at read(). * - TimedOut: @a timeout quota is exceeded. @@ -379,8 +379,8 @@ popen_read_timeout(struct popen_handle *handle, void *buf, } if (!(flags & (POPEN_FLAG_FD_STDOUT | POPEN_FLAG_FD_STDERR))) { - diag_set(IllegalParams, "popen: POPEN_FLAG_FD_STD{OUT,ERR} are " - "unset both"); + diag_set(IllegalParams, + "popen: neither stdout nor stderr is choosen"); return -1; } -- 2.25.0