From: Alexander Turenko <alexander.turenko@tarantool.org> To: Cyrill Gorcunov <gorcunov@gmail.com> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 11/12] popen: clarify popen_read_timeout error message Date: Thu, 16 Apr 2020 00:45:36 +0300 [thread overview] Message-ID: <20200415214536.2idi5zhsiypjltjm@tkn_work_nb> (raw) In-Reply-To: <20200415073930.GK3072@uranus> 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; }
next prev parent reply other threads:[~2020-04-15 21:45 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-14 11:38 [Tarantool-patches] [PATCH 00/12] Popen Lua API: preliminary patches 2 Alexander Turenko 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 01/12] popen: allow to kill process group Alexander Turenko 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 02/12] popen: add ability to keep child on deletion Alexander Turenko 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 03/12] popen: log a reason of close inherited fds failure Alexander Turenko 2020-04-14 11:52 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 04/12] popen: add missed diag_set() in popen_new() Alexander Turenko 2020-04-14 11:54 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 05/12] popen: remove retval from popen_stat() Alexander Turenko 2020-04-14 11:54 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 06/12] popen: quote multiword command arguments Alexander Turenko 2020-04-14 11:58 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 07/12] popen: add logging of duplicated logger fd Alexander Turenko 2020-04-14 11:58 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 08/12] popen: fix close-on-exec flag setting Alexander Turenko 2020-04-14 12:03 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 09/12] popen: clarify popen_{signal, delete} contract Alexander Turenko 2020-04-14 12:29 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 10/12] popen: add FIXME re group signal flaw Alexander Turenko 2020-04-14 13:19 ` Cyrill Gorcunov 2020-04-15 4:21 ` Alexander Turenko 2020-04-15 7:27 ` Cyrill Gorcunov 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 11/12] popen: clarify popen_read_timeout error message Alexander Turenko 2020-04-14 12:32 ` Cyrill Gorcunov 2020-04-15 4:21 ` Alexander Turenko 2020-04-15 7:39 ` Cyrill Gorcunov 2020-04-15 21:45 ` Alexander Turenko [this message] 2020-04-14 11:38 ` [Tarantool-patches] [PATCH 12/12] popen: allow to close parent's end of std* fds Alexander Turenko 2020-04-14 13:05 ` Cyrill Gorcunov 2020-04-15 4:21 ` Alexander Turenko 2020-04-15 7:43 ` Cyrill Gorcunov 2020-04-15 21:45 ` Alexander Turenko 2020-04-15 4:25 ` [Tarantool-patches] [PATCH 13/13] popen: add caution comment for popen_may_io() Alexander Turenko 2020-04-15 7:44 ` Cyrill Gorcunov 2020-04-15 4:52 ` [Tarantool-patches] [PATCH 14/14] popen: fix popen_write_timeout retval type Alexander Turenko 2020-04-15 23:57 ` [Tarantool-patches] [PATCH 00/12] Popen Lua API: preliminary patches 2 Alexander Turenko 2020-04-16 0:00 ` Alexander Turenko 2020-04-16 11:52 ` Cyrill Gorcunov 2020-04-17 6:58 ` Kirill Yukhin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200415214536.2idi5zhsiypjltjm@tkn_work_nb \ --to=alexander.turenko@tarantool.org \ --cc=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 11/12] popen: clarify popen_read_timeout error message' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox