mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-12-13 11:53:59 +02:00
Make changes for C89
This commit is contained in:
parent
514a01dc15
commit
1746b54978
@ -476,7 +476,7 @@ pgBackupCreateDir(pgBackup *backup)
|
|||||||
parray *external_list;
|
parray *external_list;
|
||||||
|
|
||||||
external_list = make_external_directory_list(backup->external_dir_str);
|
external_list = make_external_directory_list(backup->external_dir_str);
|
||||||
for (int i = 0; i < parray_num(external_list); i++)
|
for (i = 0; i < parray_num(external_list); i++)
|
||||||
{
|
{
|
||||||
char temp[MAXPGPATH];
|
char temp[MAXPGPATH];
|
||||||
/* Numeration of externaldirs starts with 1 */
|
/* Numeration of externaldirs starts with 1 */
|
||||||
|
15
src/merge.c
15
src/merge.c
@ -673,10 +673,12 @@ merge_files(void *arg)
|
|||||||
static void
|
static void
|
||||||
remove_dir_with_files(const char *path)
|
remove_dir_with_files(const char *path)
|
||||||
{
|
{
|
||||||
parray *files = parray_new();
|
parray *files = parray_new();
|
||||||
|
int i;
|
||||||
|
|
||||||
dir_list_file(files, path, true, true, true, 0);
|
dir_list_file(files, path, true, true, true, 0);
|
||||||
parray_qsort(files, pgFileComparePathDesc);
|
parray_qsort(files, pgFileComparePathDesc);
|
||||||
for (int i = 0; i < parray_num(files); i++)
|
for (i = 0; i < parray_num(files); i++)
|
||||||
{
|
{
|
||||||
pgFile *file = (pgFile *) parray_get(files, i);
|
pgFile *file = (pgFile *) parray_get(files, i);
|
||||||
|
|
||||||
@ -689,9 +691,11 @@ remove_dir_with_files(const char *path)
|
|||||||
static int
|
static int
|
||||||
get_external_index(const char *key, const parray *list)
|
get_external_index(const char *key, const parray *list)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
if (!list) /* Nowhere to search */
|
if (!list) /* Nowhere to search */
|
||||||
return -1;
|
return -1;
|
||||||
for (int i = 0; i < parray_num(list); i++)
|
for (i = 0; i < parray_num(list); i++)
|
||||||
{
|
{
|
||||||
if (strcmp(key, parray_get(list, i)) == 0)
|
if (strcmp(key, parray_get(list, i)) == 0)
|
||||||
return i + 1;
|
return i + 1;
|
||||||
@ -704,11 +708,12 @@ static void
|
|||||||
reorder_external_dirs(pgBackup *to_backup, parray *to_external,
|
reorder_external_dirs(pgBackup *to_backup, parray *to_external,
|
||||||
parray *from_external)
|
parray *from_external)
|
||||||
{
|
{
|
||||||
char externaldir_template[MAXPGPATH];
|
char externaldir_template[MAXPGPATH];
|
||||||
|
int i;
|
||||||
|
|
||||||
pgBackupGetPath(to_backup, externaldir_template,
|
pgBackupGetPath(to_backup, externaldir_template,
|
||||||
lengthof(externaldir_template), EXTERNAL_DIR);
|
lengthof(externaldir_template), EXTERNAL_DIR);
|
||||||
for (int i = 0; i < parray_num(to_external); i++)
|
for (i = 0; i < parray_num(to_external); i++)
|
||||||
{
|
{
|
||||||
int from_num = get_external_index(parray_get(to_external, i),
|
int from_num = get_external_index(parray_get(to_external, i),
|
||||||
from_external);
|
from_external);
|
||||||
|
Loading…
Reference in New Issue
Block a user