Re: Add SHELL_EXIT_CODE to psql
От | Maxim Orlov |
---|---|
Тема | Re: Add SHELL_EXIT_CODE to psql |
Дата | |
Msg-id | CACG=ezY7=dik8PcjA9kaLRgg=zo2bgA9Q5t6k4TQGi6tQWn5AQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add SHELL_EXIT_CODE to psql (Corey Huinker <corey.huinker@gmail.com>) |
Ответы |
Re: Add SHELL_EXIT_CODE to psql
|
Список | pgsql-hackers |
On Mon, 30 Jan 2023 at 23:23, Corey Huinker <corey.huinker@gmail.com> wrote:
I rebased, but there are no code differences.
The patch set seem to be in a good shape and pretty stable for quite a while.
Could you add one more minor improvement, a new line after variables declaration?
+ int exit_code = wait_result_to_exit_code(result);
+ char buf[32];
+ char buf[32];
...here
+ snprintf(buf, sizeof(buf), "%d", exit_code);
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");
+ char exit_code_buf[32];
... and here
+ snprintf(exit_code_buf, sizeof(exit_code_buf), "%d",
+ wait_result_to_exit_code(exit_code));
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", exit_code_buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");
+ wait_result_to_exit_code(exit_code));
+ SetVariable(pset.vars, "SHELL_EXIT_CODE", exit_code_buf);
+ SetVariable(pset.vars, "SHELL_ERROR", "true");
--
Best regards,
Maxim Orlov.
В списке pgsql-hackers по дате отправления: