diff options
-rw-r--r-- | Changelog.txt | 1 | ||||
-rw-r--r-- | src/common/lock.c | 8 |
2 files changed, 8 insertions, 1 deletions
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 <stdio.h> +#include <errno.h> +#include <string.h> #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; |