From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (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 6C7184696C3 for ; Thu, 16 Apr 2020 00:45:41 +0300 (MSK) Date: Thu, 16 Apr 2020 00:45:36 +0300 From: Alexander Turenko Message-ID: <20200415214536.2idi5zhsiypjltjm@tkn_work_nb> References: <20200415042136.p6udliisud4da2kf@tkn_work_nb> <20200415073930.GK3072@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200415073930.GK3072@uranus> Subject: Re: [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 On Wed, Apr 15, 2020 at 10:39:30AM +0300, Cyrill Gorcunov wrote: > On Wed, Apr 15, 2020 at 07:21:36AM +0300, Alexander Turenko wrote: > > > > > > 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; > > > } > > > > I was inattentive: there is an error message of the same style in > > popen_read_timeout(). Those functions should be changed both together. > > I think better "popen: neither stdout nor stderr is set", but no > strong preferences here (except there is no such word as 'choosen') Strictly speaking ...FD_STD{OUT,ERR} can be set, they are flags. But stdout / stderr are not flags, it is a stream on which a user want to do an operaton. It is requested, askec, chosen. However options in the Lua API names exactly as 'stdin', 'stdout', 'stderr': so 'set' is meaningful for the Lua API. Anyway, I guess 'stdout is set' is handy shortcut for formal 'asked to operate on stdout'. So I'll just use 'set' here. Thanks for the advice! ---- The incremental diff: diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index d33efbb18..ee16da28b 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -297,7 +297,7 @@ stdX_str(unsigned int index) * * - IllegalParams: a parameter check fails: * - count: data is too big. - * - flags: stdin is not choosen. + * - flags: stdin is not set. * - handle: handle does not support the requested IO operation. * - SocketError: an IO error occurs at write(). * - TimedOut: @a timeout quota is exceeded. @@ -322,7 +322,7 @@ popen_write_timeout(struct popen_handle *handle, const void *buf, } if (!(flags & POPEN_FLAG_FD_STDIN)) { - diag_set(IllegalParams, "popen: stdin is not choosen"); + diag_set(IllegalParams, "popen: stdin is not set"); return -1; } @@ -359,7 +359,7 @@ popen_write_timeout(struct popen_handle *handle, const void *buf, * * - IllegalParams: a parameter check fails: * - count: buffer is too big. - * - flags: stdout and stdrr are both choosen or both missed + * - flags: stdout and stdrr are both set 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,7 +379,7 @@ popen_read_timeout(struct popen_handle *handle, void *buf, if (!(flags & (POPEN_FLAG_FD_STDOUT | POPEN_FLAG_FD_STDERR))) { diag_set(IllegalParams, - "popen: neither stdout nor stderr is choosen"); + "popen: neither stdout nor stderr is set"); return -1; }