Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc678325

Browse files
committed
Add backup_label to file_database.txt for all checks.
1 parente829899 commitc678325

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

‎backup.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ get_lsn(PGconn *conn, PGresult *res, XLogRecPtr *lsn, bool stop_backup)
888888
charpath_backup_label[MAXPGPATH];
889889
charpath_tablespace_map[MAXPGPATH];
890890
FILE*fp;
891+
pgFile*file;
891892

892893
pgBackupGetPath(&current,path,lengthof(path),DATABASE_DIR);
893894
snprintf(path_backup_label,lengthof(path_backup_label),"%s/backup_label",path);
@@ -900,6 +901,11 @@ get_lsn(PGconn *conn, PGresult *res, XLogRecPtr *lsn, bool stop_backup)
900901

901902
fwrite(PQgetvalue(res,0,1),1,strlen(PQgetvalue(res,0,1)),fp);
902903
fclose(fp);
904+
file=pgFileNew(path_backup_label, true);
905+
calc_file(file);
906+
free(file->path);
907+
file->path=strdup("backup_label");
908+
parray_append(backup_files_list,file);
903909
if (strlen(PQgetvalue(res,0,2))==0)
904910
return;
905911

@@ -910,6 +916,11 @@ get_lsn(PGconn *conn, PGresult *res, XLogRecPtr *lsn, bool stop_backup)
910916

911917
fwrite(PQgetvalue(res,0,2),1,strlen(PQgetvalue(res,0,2)),fp);
912918
fclose(fp);
919+
file=pgFileNew(path_tablespace_map, true);
920+
calc_file(file);
921+
free(file->path);
922+
file->path=strdup("tablespace_map");
923+
parray_append(backup_files_list,file);
913924
}
914925
}
915926

‎data.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -722,14 +722,16 @@ calc_file(pgFile *file)
722722

723723
for (;;)
724724
{
725-
if ((read_len=fread(buf,1,sizeof(buf),in))!=sizeof(buf))
725+
read_len=fread(buf,1,sizeof(buf),in);
726+
727+
if(read_len==0)
726728
break;
727729

728730
/* update CRC */
729731
COMP_CRC32C(crc,buf,read_len);
730732

731-
file->write_size+=sizeof(buf);
732-
file->read_size+=sizeof(buf);
733+
file->write_size+=read_len;
734+
file->read_size+=read_len;
733735
}
734736

735737
errno_tmp=errno;

‎dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const char *pgdata_exclude[] =
3131
NULL
3232
};
3333

34-
staticpgFile*pgFileNew(constchar*path,boolomit_symlink);
34+
pgFile*pgFileNew(constchar*path,boolomit_symlink);
3535
staticintBlackListCompare(constvoid*str1,constvoid*str2);
3636

3737
/* create directory, also create parent directories if necessary */
@@ -60,7 +60,7 @@ dir_create_dir(const char *dir, mode_t mode)
6060
return0;
6161
}
6262

63-
staticpgFile*
63+
pgFile*
6464
pgFileNew(constchar*path,boolomit_symlink)
6565
{
6666
structstatst;

‎pg_arman.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ extern parray *dir_read_file_list(const char *root, const char *file_txt);
283283
externintdir_create_dir(constchar*path,mode_tmode);
284284
externvoiddir_copy_files(constchar*from_root,constchar*to_root);
285285

286+
externpgFile*pgFileNew(constchar*path,boolomit_symlink);
286287
externvoidpgFileDelete(pgFile*file);
287288
externvoidpgFileFree(void*file);
288289
externpg_crc32pgFileGetCRC(pgFile*file);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp