diff options
author | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-22 12:42:29 +0000 |
---|---|---|
committer | celest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-22 12:42:29 +0000 |
commit | 8330a31037eefbf27f5da5b8b283241f68addb94 (patch) | |
tree | 570a0f2a74a74c003168f06066d58649e91d59b0 /src | |
parent | ec57a1ffe9c6f065338ff209a218429aff174d20 (diff) | |
download | hercules-8330a31037eefbf27f5da5b8b283241f68addb94.tar.gz hercules-8330a31037eefbf27f5da5b8b283241f68addb94.tar.bz2 hercules-8330a31037eefbf27f5da5b8b283241f68addb94.tar.xz hercules-8330a31037eefbf27f5da5b8b283241f68addb94.zip |
* 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
Diffstat (limited to 'src')
-rw-r--r-- | src/common/lock.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; |