From 8330a31037eefbf27f5da5b8b283241f68addb94 Mon Sep 17 00:00:00 2001 From: celest Date: Wed, 22 Dec 2004 12:42:29 +0000 Subject: * Added error message if file renaming in lock_fclose fails * Corrected typo in clif_hpmeter * Fixed frost diver git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@727 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 1 + src/common/lock.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 826f36270..4deeb3cc8 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,6 @@ Date Added 12/22 + * Added error message if file renaming in lock_fclose fails [celest] * Fixed frost diver not working ... my bad =p [celest] * Corrected typo in clif_hpmeter - md -> sd [celest] * Check if the player has been authentified by the char server before diff --git a/src/common/lock.c b/src/common/lock.c index 9a2205bf4..341903434 100644 --- a/src/common/lock.c +++ b/src/common/lock.c @@ -1,6 +1,9 @@ #include +#include +#include #include "lock.h" +#include "showmsg.h" // 書き込みファイルの保護処理 // (書き込みが終わるまで、旧ファイルを保管しておく) @@ -28,7 +31,10 @@ int lock_fclose(FILE *fp,const char* filename,int *info) { sprintf(newfile,"%s_%04d.tmp",filename,*info); remove(filename); // このタイミングで落ちると最悪。 - rename(newfile,filename); + if (rename(newfile,filename) != 0) { + sprintf(tmp_output,"%s - '"CL_WHITE"%s"CL_RESET"'\n", strerror(errno), newfile); + ShowError(tmp_output); + } return ret; } else { return 1; -- cgit v1.2.3-70-g09d2