mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-12 09:06:55 -04:00
Don't bother logging errors for closing readonly files
This commit is contained in:
parent
84356f0847
commit
a761f2718b
@ -925,9 +925,10 @@ static cc_result Sound_ReadWave(const cc_string* path, struct Sound* snd) {
|
||||
res = Stream_OpenFile(&stream, path);
|
||||
if (res) return res;
|
||||
res = Sound_ReadWaveData(&stream, snd);
|
||||
if (res) { stream.Close(&stream); return res; }
|
||||
|
||||
return stream.Close(&stream);
|
||||
/* No point logging error for closing readonly file */
|
||||
(void)stream.Close(&stream);
|
||||
return res;
|
||||
}
|
||||
|
||||
static struct SoundGroup* Soundboard_Find(struct Soundboard* board, const cc_string* name) {
|
||||
|
@ -71,8 +71,8 @@ void Map_LoadFrom(const cc_string* path) {
|
||||
Logger_SysWarn2(res, "decoding", path);
|
||||
}
|
||||
|
||||
res = stream.Close(&stream);
|
||||
if (res) { Logger_SysWarn2(res, "closing", path); }
|
||||
/* No point logging error for closing readonly file */
|
||||
stream.Close(&stream);
|
||||
|
||||
World_SetNewMap(World.Blocks, World.Width, World.Height, World.Length);
|
||||
LocalPlayer_MoveToSpawn();
|
||||
|
@ -466,7 +466,8 @@ static void ExtractTexturePack(const cc_string* path) {
|
||||
res = Zip_Extract(&state);
|
||||
|
||||
if (res) { Logger_SysWarn(res, "extracting texture pack"); }
|
||||
stream.Close(&stream);
|
||||
/* No point logging error for closing readonly file */
|
||||
(void)stream.Close(&stream);
|
||||
}
|
||||
|
||||
void Launcher_TryLoadTexturePack(void) {
|
||||
|
@ -349,8 +349,8 @@ static void ExtractFromFile(const cc_string* filename) {
|
||||
}
|
||||
|
||||
ExtractFrom(&stream, &path);
|
||||
res = stream.Close(&stream);
|
||||
if (res) { Logger_SysWarn2(res, "closing", &path); }
|
||||
/* No point logging error for closing readonly file */
|
||||
(void)stream.Close(&stream);
|
||||
}
|
||||
|
||||
static void ExtractDefault(void) {
|
||||
@ -377,8 +377,8 @@ void TexturePack_ExtractCurrent(cc_bool forceReload) {
|
||||
ExtractFrom(&stream, &url);
|
||||
usingDefault = false;
|
||||
|
||||
res = stream.Close(&stream);
|
||||
if (res) Logger_SysWarn2(res, "closing cache for", &url);
|
||||
/* No point logging error for closing readonly file */
|
||||
(void)stream.Close(&stream);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -264,8 +264,8 @@ cc_result EntryList_Load(struct StringsBuffer* list, const char* file, char sepa
|
||||
}
|
||||
}
|
||||
|
||||
res = stream.Close(&stream);
|
||||
if (res) { Logger_SysWarn2(res, "closing", &path); }
|
||||
/* No point logging error for closing readonly file */
|
||||
(void)stream.Close(&stream);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user