Fix keydb-cli crashing on read-only filesystem
Former-commit-id: 91eac2cdb32d5cd5eb9c1fc54244da08faf8d9e7
This commit is contained in:
parent
37ff25cecf
commit
9bedd4d3d5
@ -6594,6 +6594,8 @@ static char *fetchMOTDFromCache()
|
|||||||
static void setMOTDCache(const char *sz)
|
static void setMOTDCache(const char *sz)
|
||||||
{
|
{
|
||||||
FILE *pf = fopen(szMotdCachePath(), "wb");
|
FILE *pf = fopen(szMotdCachePath(), "wb");
|
||||||
|
if (pf == NULL)
|
||||||
|
return;
|
||||||
size_t celem = fwrite(sz, strlen(sz), 1, pf);
|
size_t celem = fwrite(sz, strlen(sz), 1, pf);
|
||||||
(void)celem; // best effort
|
(void)celem; // best effort
|
||||||
fclose(pf);
|
fclose(pf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user