From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp49.i.mail.ru (smtp49.i.mail.ru [94.100.177.109]) (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 DF54F4696CA for ; Fri, 10 Apr 2020 05:51:18 +0300 (MSK) From: Alexander Turenko Date: Fri, 10 Apr 2020 05:50:46 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 08/13] popen: unblock popen_read_timeout at a first byte List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tarantool-patches@dev.tarantool.org Before this change popen_read_timeout() waits until a passed buffer will be fully filled (or until EOF / timeout / IO error occurs). Now it waits for any amount of data (but at least one byte). It allows to communicate with an interactive child program: write, read, repeat. Part of #4031 --- src/lib/core/popen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index dbc700287..660ace0d5 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -345,8 +345,8 @@ popen_read_timeout(struct popen_handle *handle, void *buf, handle->pid, stdX_str(idx), idx, buf, count, handle->ios[idx].fd, timeout); - return coio_read_timeout(&handle->ios[idx], buf, - count, timeout); + return coio_read_ahead_timeout(&handle->ios[idx], buf, 1, count, + timeout); } /** -- 2.25.0