diff options
| author | Tom Lane | 2023-03-21 17:03:42 +0000 |
|---|---|---|
| committer | Tom Lane | 2023-03-21 17:03:56 +0000 |
| commit | b0d8f2d983cb25d1035fae1cd7de214dd67809b4 (patch) | |
| tree | 765a0ea3579a960f3574a38e229338011b804e3a /src/include | |
| parent | 0f85db92b9ea167d3b9e90f3fb5fb3b9a93babc2 (diff) | |
Add SHELL_ERROR and SHELL_EXIT_CODE magic variables to psql.
These are set after a \! command or a backtick substitution.
SHELL_ERROR is just "true" for error (nonzero exit status) or "false"
for success, while SHELL_EXIT_CODE records the actual exit status
following standard shell/system(3) conventions.
Corey Huinker, reviewed by Maxim Orlov and myself
Discussion: https://postgr.es/m/CADkLM=cWao2x2f+UDw15W1JkVFr_bsxfstw=NGea7r9m4j-7rQ@mail.gmail.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/port.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/port.h b/src/include/port.h index e66193bed9..a88d403483 100644 --- a/src/include/port.h +++ b/src/include/port.h @@ -495,6 +495,7 @@ extern char *escape_single_quotes_ascii(const char *src); extern char *wait_result_to_str(int exitstatus); extern bool wait_result_is_signal(int exit_status, int signum); extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found); +extern int wait_result_to_exit_code(int exit_status); /* * Interfaces that we assume all Unix system have. We retain individual macros |
