MCPcopy Create free account
hub / github.com/apache/cloudberry / ClosePager

Function ClosePager

src/fe_utils/print.c:3026–3045  ·  view source on GitHub ↗

* ClosePager * * Close previously opened pager pipe, if any */

Source from the content-addressed store, hash-verified

3024 * Close previously opened pager pipe, if any
3025 */
3026void
3027ClosePager(FILE *pagerpipe)
3028{
3029 if (pagerpipe && pagerpipe != stdout)
3030 {
3031 /*
3032 * If printing was canceled midstream, warn about it.
3033 *
3034 * Some pagers like less use Ctrl-C as part of their command set. Even
3035 * so, we abort our processing and warn the user what we did. If the
3036 * pager quit as a result of the SIGINT, this message won't go
3037 * anywhere ...
3038 */
3039 if (cancel_pressed)
3040 fprintf(pagerpipe, _("Interrupted\n"));
3041
3042 pclose(pagerpipe);
3043 restore_sigpipe_trap();
3044 }
3045}
3046
3047/*
3048 * Initialise a table contents struct.

Callers 10

print_aligned_textFunction · 0.85
print_aligned_verticalFunction · 0.85
printTableFunction · 0.85
usageFunction · 0.85
slashUsageFunction · 0.85
helpVariablesFunction · 0.85
helpSQLFunction · 0.85
printHistoryFunction · 0.85
ExecQueryUsingCursorFunction · 0.85
exec_command_sf_svFunction · 0.85

Calls 1

restore_sigpipe_trapFunction · 0.85

Tested by

no test coverage detected