Fix keydb-cli crashing on read-only filesystem

Former-commit-id: 91eac2cdb32d5cd5eb9c1fc54244da08faf8d9e7
This commit is contained in:
Tais P. Hansen 2019-12-09 13:48:08 +01:00 committed by John Sully
parent 37ff25cecf
commit 9bedd4d3d5

View File

@ -6594,6 +6594,8 @@ static char *fetchMOTDFromCache()
static void setMOTDCache(const char *sz)
{
FILE *pf = fopen(szMotdCachePath(), "wb");
if (pf == NULL)
return;
size_t celem = fwrite(sz, strlen(sz), 1, pf);
(void)celem; // best effort
fclose(pf);