1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-18 04:58:51 +02:00

Add timeModified parameter to HRN_STORAGE_PUT() macro.

This commit is contained in:
Cynthia Shang 2021-06-28 12:14:26 -04:00 committed by David Steele
parent 065a8c8454
commit c6208113bf
3 changed files with 9 additions and 2 deletions

View File

@ -77,6 +77,7 @@
<commit subject="Replace defines with string constants in unit tests.">
<github-pull-request id="1440"/>
</commit>
<commit subject="Add timeModified parameter to HRN_STORAGE_PUT() macro."/>
<release-item-contributor-list>
<release-item-contributor id="cynthia.shang"/>

View File

@ -403,15 +403,20 @@ hrnStoragePut(
compressExtCat(fileStr, param.compressType);
// Create file
StorageWrite *destination = storageNewWriteP(storage, fileStr, .modeFile = param.modeFile);
StorageWrite *destination = storageNewWriteP(storage, fileStr, .modeFile = param.modeFile, .timeModified = param.timeModified);
IoFilterGroup *filterGroup = ioWriteFilterGroup(storageWriteIo(destination));
// Add mode to output information filter
// Declare an information filter for displaying paramaters to the output
String *const filter = strNew();
// Add mode to output information filter
if (param.modeFile != 0)
strCatFmt(filter, "mode[%04o]", param.modeFile);
// Add modified time to output information filter
if (param.timeModified != 0)
strCatFmt(filter, "%stime[%" PRIu64 "]", strEmpty(filter) ? "" : "/", (uint64_t)param.timeModified);
// Add compression filter
if (param.compressType != compressTypeNone)
{

View File

@ -190,6 +190,7 @@ typedef struct HrnStoragePutParam
{
VAR_PARAM_HEADER;
mode_t modeFile; // File mode if not the default
time_t timeModified; // Time file was last modified
CompressType compressType;
CipherType cipherType;
const char *cipherPass;