Selaa lähdekoodia

* Added error message if file renaming in lock_fclose fails
* Corrected typo in clif_hpmeter
* Fixed frost diver

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@727 54d463be-8e91-2dee-dedb-b68131a5f0ec

celest 20 vuotta sitten
vanhempi
commit
bbee501b4d
2 muutettua tiedostoa jossa 8 lisäystä ja 1 poistoa
  1. 1 0
      Changelog.txt
  2. 7 1
      src/common/lock.c

+ 1 - 0
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

+ 7 - 1
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;