mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 08:06:29 +00:00
Only collect remote command output if the caller requires it
This addresses GitHub #216 and #167.
This commit is contained in:
committed by
Ian Barwick
parent
00e55c0672
commit
85f68e9f77
15
repmgr.c
15
repmgr.c
@@ -3526,7 +3526,7 @@ do_standby_switchover(void)
|
|||||||
remote_host,
|
remote_host,
|
||||||
runtime_options.remote_user,
|
runtime_options.remote_user,
|
||||||
command,
|
command,
|
||||||
&command_output);
|
NULL);
|
||||||
|
|
||||||
termPQExpBuffer(&command_output);
|
termPQExpBuffer(&command_output);
|
||||||
|
|
||||||
@@ -5956,15 +5956,18 @@ remote_command(const char *host, const char *user, const char *command, PQExpBuf
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: better error handling */
|
if (outputbuf != NULL)
|
||||||
while (fgets(output, MAXLEN, fp) != NULL)
|
|
||||||
{
|
{
|
||||||
appendPQExpBuffer(outputbuf, "%s", output);
|
/* TODO: better error handling */
|
||||||
|
while (fgets(output, MAXLEN, fp) != NULL)
|
||||||
|
{
|
||||||
|
appendPQExpBuffer(outputbuf, "%s", output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
|
|
||||||
log_verbose(LOG_DEBUG, "remote_command(): output returned was:\n%s", outputbuf->data);
|
if (outputbuf != NULL)
|
||||||
|
log_verbose(LOG_DEBUG, "remote_command(): output returned was:\n%s", outputbuf->data);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user