From: Artem via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>,
Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCHv2 2/2] lua: fix tarantool -e always enters interactive mode
Date: Sat, 20 Feb 2021 14:27:25 +0300 [thread overview]
Message-ID: <7be00375-3b9b-5779-a458-e541168c7eb8@tarantool.org> (raw)
In-Reply-To: <ae103ffb-86a2-edb1-2727-a52da0da03a3@tarantool.org>
Thanks for the review!
>> diff --git a/src/lib/core/errinj.h b/src/lib/core/errinj.h
>> index d76aedf7a..d5fdbc209 100644
>> --- a/src/lib/core/errinj.h
>> +++ b/src/lib/core/errinj.h
>> @@ -149,6 +149,7 @@ struct errinj {
>> _(ERRINJ_AUTO_UPGRADE, ERRINJ_BOOL, {.bparam = false})\
>> _(ERRINJ_COIO_WRITE_CHUNK, ERRINJ_BOOL, {.bparam = false}) \
>> _(ERRINJ_APPLIER_SLOW_ACK, ERRINJ_BOOL, {.bparam = false}) \
>> + _(ERRINJ_STDIN_ISATTY, ERRINJ_INT, {.iparam = -1}) \
>
> 1. according to name (ISATTY) variable can be in enabled or disabled
> state so
>
> why do you use integer type here?
1. I use integer type for ISATTY cause this injection "overrides" return
value of
standard isatty function for stdin. It can be set to 0 or 1. Default
value -1 means
to use return value of standard function.
>> ENUM0(errinj_id, ERRINJ_LIST);
>> extern struct errinj errinjs[];
>> diff --git a/src/lua/init.c b/src/lua/init.c
>> index 25e8884a6..e7e0fe006 100644
>> --- a/src/lua/init.c
>> +++ b/src/lua/init.c
>> @@ -62,6 +62,7 @@
>> #include "lua/swim.h"
>> #include "lua/decimal.h"
>> #include "digest.h"
>> +#include "errinj.h"
>> #include <small/ibuf.h>
>> #include <ctype.h>
>> @@ -583,6 +584,7 @@ run_script_f(va_list ap)
>> */
>> struct diag *diag = va_arg(ap, struct diag *);
>> bool aux_loop_is_run = false;
>> + bool option_e_runned = false;
>> /*
>> * Load libraries and execute chunks passed by -l and -e
>> @@ -613,6 +615,7 @@ run_script_f(va_list ap)
>> if (luaT_call(L, 0, 0) != 0)
>> goto error;
>> lua_settop(L, 0);
>> + option_e_runned = true;
>> break;
>> default:
>> unreachable(); /* checked by getopt() in main() */
>> @@ -627,25 +630,34 @@ run_script_f(va_list ap)
>> fiber_sleep(0.0);
>> aux_loop_is_run = true;
>> + int is_atty;
>
> 2. is_a_tty?
>
2. Done.
next prev parent reply other threads:[~2021-02-20 11:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 19:30 [Tarantool-patches] [PATCHv2 0/2] " Artem Starshov via Tarantool-patches
2021-02-18 19:30 ` [Tarantool-patches] [PATCHv2 1/2] core: add setting error injections via env Artem Starshov via Tarantool-patches
2021-02-20 9:03 ` Sergey Bronnikov via Tarantool-patches
2021-02-20 11:21 ` Artem via Tarantool-patches
2021-02-20 14:27 ` Sergey Bronnikov via Tarantool-patches
2021-02-24 9:38 ` Artem via Tarantool-patches
2021-02-25 14:36 ` Sergey Bronnikov via Tarantool-patches
2021-03-01 14:47 ` Leonid Vasiliev via Tarantool-patches
2021-03-02 17:00 ` Artem via Tarantool-patches
2021-02-18 19:30 ` [Tarantool-patches] [PATCHv2 2/2] lua: fix tarantool -e always enters interactive mode Artem Starshov via Tarantool-patches
2021-02-19 9:15 ` Konstantin Osipov via Tarantool-patches
2021-02-19 14:33 ` Artem via Tarantool-patches
2021-02-20 10:05 ` Sergey Bronnikov via Tarantool-patches
2021-02-20 11:27 ` Artem via Tarantool-patches [this message]
2021-03-01 15:10 ` Leonid Vasiliev via Tarantool-patches
2021-03-02 17:05 ` Artem via Tarantool-patches
2021-03-03 12:55 ` Leonid Vasiliev via Tarantool-patches
2021-02-25 14:37 ` [Tarantool-patches] [PATCHv2 0/2] " Sergey Bronnikov via Tarantool-patches
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=7be00375-3b9b-5779-a458-e541168c7eb8@tarantool.org \
--to=tarantool-patches@dev.tarantool.org \
--cc=alexander.turenko@tarantool.org \
--cc=artemreyt@tarantool.org \
--cc=sergeyb@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCHv2 2/2] lua: fix tarantool -e always enters interactive mode' \
/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