From e5a133db8b063649a4856eef46a1abeb6c019be0 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 1 Mar 2012 23:35:53 +0000 Subject: [PATCH] When failing to open a savegame file for writing, print the reason to the log. git-svn-id: https://svn.eduke32.com/eduke32@2393 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/savegame.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 55d0a86b8..1e5e80837 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -881,9 +881,14 @@ int32_t G_SavePlayer(int32_t spot) Bsnprintf(temp, sizeof(temp), "%s", fn); temp[sizeof(temp)-1] = 0; + errno = 0; fil = fopen(temp, "wb"); if (!fil) + { return -1; + OSD_Printf("G_SavePlayer: failed opening '%s' for writing: %s\n", + temp, strerror(errno)); + } } #ifdef POLYMER