1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-05 15:05:48 +02:00

Add missing mode_t casts.

Found on MacOS M1 where mode_t is short.
This commit is contained in:
David Steele 2021-01-21 17:23:24 -05:00
parent 4b3200961e
commit 6a992a5884
5 changed files with 9 additions and 8 deletions

View File

@ -43,7 +43,8 @@ restoreProtocol(const String *command, const VariantList *paramList, ProtocolSer
varStr(varLstGet(paramList, 0)), varStr(varLstGet(paramList, 1)),
(CompressType)varUIntForce(varLstGet(paramList, 2)), varStr(varLstGet(paramList, 3)),
varStr(varLstGet(paramList, 4)), varBoolForce(varLstGet(paramList, 5)), varUInt64(varLstGet(paramList, 6)),
(time_t)varInt64Force(varLstGet(paramList, 7)), cvtZToUIntBase(strZ(varStr(varLstGet(paramList, 8))), 8),
(time_t)varInt64Force(varLstGet(paramList, 7)),
(mode_t)cvtZToUIntBase(strZ(varStr(varLstGet(paramList, 8))), 8),
varStr(varLstGet(paramList, 9)), varStr(varLstGet(paramList, 10)),
(time_t)varInt64Force(varLstGet(paramList, 11)), varBoolForce(varLstGet(paramList, 12)),
varBoolForce(varLstGet(paramList, 13)), varStr(varLstGet(paramList, 14)))));

View File

@ -333,7 +333,7 @@ cvtZToMode(const char *value)
ASSERT(value != NULL);
FUNCTION_TEST_RETURN(cvtZToUIntBase(value, 8));
FUNCTION_TEST_RETURN((mode_t)cvtZToUIntBase(value, 8));
}
/**********************************************************************************************************************************/

View File

@ -2283,7 +2283,7 @@ manifestSave(Manifest *this, IoWrite *write)
}
saveData.fileGroupDefault = manifestOwnerVar(varStr(mcvResult(fileGroupMcv)));
saveData.fileModeDefault = varUInt(mcvResult(fileModeMcv));
saveData.fileModeDefault = (mode_t)varUInt(mcvResult(fileModeMcv));
saveData.filePrimaryDefault = varBool(mcvResult(filePrimaryMcv));
saveData.fileUserDefault = manifestOwnerVar(varStr(mcvResult(fileUserMcv)));
@ -2322,7 +2322,7 @@ manifestSave(Manifest *this, IoWrite *write)
}
saveData.pathGroupDefault = manifestOwnerVar(varStr(mcvResult(pathGroupMcv)));
saveData.pathModeDefault = varUInt(mcvResult(pathModeMcv));
saveData.pathModeDefault = (mode_t)varUInt(mcvResult(pathModeMcv));
saveData.pathUserDefault = manifestOwnerVar(varStr(mcvResult(pathUserMcv)));
// Save manifest

View File

@ -240,8 +240,8 @@ storageRemoteProtocol(const String *command, const VariantList *paramList, Proto
// Create the write object
IoWrite *fileWrite = storageWriteIo(
storageInterfaceNewWriteP(
driver, varStr(varLstGet(paramList, 0)), .modeFile = varUIntForce(varLstGet(paramList, 1)),
.modePath = varUIntForce(varLstGet(paramList, 2)), .user = varStr(varLstGet(paramList, 3)),
driver, varStr(varLstGet(paramList, 0)), .modeFile = (mode_t)varUIntForce(varLstGet(paramList, 1)),
.modePath = (mode_t)varUIntForce(varLstGet(paramList, 2)), .user = varStr(varLstGet(paramList, 3)),
.group = varStr(varLstGet(paramList, 4)), .timeModified = (time_t)varUInt64Force(varLstGet(paramList, 5)),
.createPath = varBool(varLstGet(paramList, 6)), .syncFile = varBool(varLstGet(paramList, 7)),
.syncPath = varBool(varLstGet(paramList, 8)), .atomic = varBool(varLstGet(paramList, 9))));
@ -302,7 +302,7 @@ storageRemoteProtocol(const String *command, const VariantList *paramList, Proto
{
storageInterfacePathCreateP(
driver, varStr(varLstGet(paramList, 0)), varBool(varLstGet(paramList, 1)), varBool(varLstGet(paramList, 2)),
varUIntForce(varLstGet(paramList, 3)));
(mode_t)varUIntForce(varLstGet(paramList, 3)));
protocolServerResponse(server, NULL);
}

View File

@ -51,7 +51,7 @@ storageRemoteInfoParse(ProtocolClient *client, StorageInfo *info)
info->user = jsonToStr(protocolClientReadLine(client));
info->groupId = jsonToUInt(protocolClientReadLine(client));
info->group = jsonToStr(protocolClientReadLine(client));
info->mode = jsonToUInt(protocolClientReadLine(client));
info->mode = (mode_t)jsonToUInt(protocolClientReadLine(client));
if (info->type == storageTypeLink)
info->linkDestination = jsonToStr(protocolClientReadLine(client));