mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Remove unused PQexpBuffer
It was being referenced without being initialised, but the output which would have been placed there is not used anyway, so discard completely.
This commit is contained in:
@@ -2267,7 +2267,6 @@ run_file_backup(void)
|
||||
char basebackups_directory[MAXLEN];
|
||||
char backup_id[MAXLEN] = "";
|
||||
char *p, *q;
|
||||
PQExpBufferData command_output;
|
||||
TablespaceDataList tablespace_list = { NULL, NULL };
|
||||
TablespaceDataListCell *cell_t;
|
||||
|
||||
@@ -2361,7 +2360,7 @@ run_file_backup(void)
|
||||
local_repmgr_tmp_directory);
|
||||
(void)local_command(
|
||||
command,
|
||||
&command_output);
|
||||
NULL);
|
||||
|
||||
/*
|
||||
* Get tablespace data
|
||||
@@ -2471,7 +2470,7 @@ run_file_backup(void)
|
||||
|
||||
(void)local_command(
|
||||
command,
|
||||
&command_output);
|
||||
NULL);
|
||||
|
||||
unlink(datadir_list_filename);
|
||||
|
||||
@@ -2573,7 +2572,7 @@ run_file_backup(void)
|
||||
tblspc_dir_dest);
|
||||
(void)local_command(
|
||||
command,
|
||||
&command_output);
|
||||
NULL);
|
||||
fclose(cell_t->f);
|
||||
maxlen_snprintf(filename,
|
||||
"%s/%s.txt",
|
||||
|
||||
@@ -1565,31 +1565,29 @@ local_command(const char *command, PQExpBufferData *outputbuf)
|
||||
retval = system(command);
|
||||
return (retval == 0) ? true : false;
|
||||
}
|
||||
else
|
||||
|
||||
fp = popen(command, "r");
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
fp = popen(command, "r");
|
||||
|
||||
if (fp == NULL)
|
||||
{
|
||||
log_error(_("unable to execute local command:\n%s"), command);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* TODO: better error handling */
|
||||
while (fgets(output, MAXLEN, fp) != NULL)
|
||||
{
|
||||
appendPQExpBuffer(outputbuf, "%s", output);
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
if (outputbuf->data != NULL)
|
||||
log_verbose(LOG_DEBUG, "local_command(): output returned was:\n%s", outputbuf->data);
|
||||
else
|
||||
log_verbose(LOG_DEBUG, "local_command(): no output returned");
|
||||
|
||||
return true;
|
||||
log_error(_("unable to execute local command:\n%s"), command);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* TODO: better error handling */
|
||||
while (fgets(output, MAXLEN, fp) != NULL)
|
||||
{
|
||||
appendPQExpBuffer(outputbuf, "%s", output);
|
||||
}
|
||||
|
||||
pclose(fp);
|
||||
|
||||
if (outputbuf->data != NULL)
|
||||
log_verbose(LOG_DEBUG, "local_command(): output returned was:\n%s", outputbuf->data);
|
||||
else
|
||||
log_verbose(LOG_DEBUG, "local_command(): no output returned");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user