Quellcode durchsuchen

Removed lock files since it is no longer being used (bugreport:6767).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16898 54d463be-8e91-2dee-dedb-b68131a5f0ec
momacabu vor 12 Jahren
Ursprung
Commit
294217c2ad
3 geänderte Dateien mit 4 neuen und 80 gelöschten Zeilen
  1. 4 9
      src/common/Makefile.in
  2. 0 59
      src/common/lock.c
  3. 0 12
      src/common/lock.h

+ 4 - 9
src/common/Makefile.in

@@ -1,5 +1,5 @@
 
-COMMON_OBJ = obj_all/core.o obj_all/socket.o obj_all/timer.o obj_all/db.o obj_all/lock.o \
+COMMON_OBJ = obj_all/core.o obj_all/socket.o obj_all/timer.o obj_all/db.o \
 	obj_all/nullpo.o obj_all/malloc.o obj_all/showmsg.o obj_all/strlib.o obj_all/utils.o \
 	obj_all/grfio.o obj_all/mapindex.o obj_all/ers.o obj_all/md5calc.o \
 	obj_all/minicore.o obj_all/minisocket.o obj_all/minimalloc.o obj_all/random.o obj_all/des.o \
@@ -23,23 +23,19 @@ LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
 
 HAVE_MYSQL=@HAVE_MYSQL@
 ifeq ($(HAVE_MYSQL),yes)
-	ALL_DEPENDS=txt sql
+	ALL_DEPENDS=sql
 	SQL_DEPENDS=common common_sql
 else
-	ALL_TARGET=txt
 	SQL_DEPENDS=needs_mysql
 endif
-TXT_DEPENDS=common
 
 @SET_MAKE@
 
 #####################################################################
-.PHONY : all txt sql clean help
+.PHONY : all sql clean help
 
 all: $(ALL_DEPENDS)
 
-txt: $(TXT_DEPENDS)
-
 sql: $(SQL_DEPENDS)
 
 clean:
@@ -47,8 +43,7 @@ clean:
 	@rm -rf *.o obj_all obj_sql
 
 help:
-	@echo "possible targets are 'txt' 'sql' 'all' 'clean' 'help'"
-	@echo "'txt'    - builds object files used in txt servers"
+	@echo "possible targets are 'sql' 'all' 'clean' 'help'"
 	@echo "'sql'    - builds object files used in sql servers"
 	@echo "'all'    - builds all above targets"
 	@echo "'clean'  - cleans builds and objects"

+ 0 - 59
src/common/lock.c

@@ -1,59 +0,0 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#include "cbasetypes.h"
-#include "showmsg.h"
-#include "utils.h"
-#include "lock.h"
-
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#ifndef WIN32
-#include <unistd.h>
-#else
-#include "../common/winapi.h"
-#endif
-
-// 書き込みファイルの保護処理
-// (書き込みが終わるまで、旧ファイルを保管しておく)
-
-// 新しいファイルの書き込み開始
-FILE* lock_fopen (const char* filename, int *info) {
-	char newfile[512];
-	int no = 0;
-
-	// 安全なファイル名を得る(手抜き)
-	do {
-		sprintf(newfile, "%s_%04d.tmp", filename, ++no);
-	} while(exists(newfile) && no < 9999);
-	*info = no;
-	return fopen(newfile,"w");
-}
-
-// 旧ファイルを削除&新ファイルをリネーム
-int lock_fclose (FILE *fp, const char* filename, int *info) {
-	int ret = 1;
-	char newfile[512];
-	char oldfile[512];
-	if (fp != NULL) {
-		ret = fclose(fp);
-		sprintf(newfile, "%s_%04d.tmp", filename, *info);
-		sprintf(oldfile, "%s.bak", filename);	// old backup file
-
-		if (exists(oldfile)) remove(oldfile);	// remove backup file if it already exists
-		rename (filename, oldfile);				// backup our older data instead of deleting it
-
-		// このタイミングで落ちると最悪。
-		if ((ret = rename(newfile,filename)) != 0) {	// rename our temporary file to its correct name
-#if defined(__NETBSD__) || defined(_WIN32) || defined(sun) || defined (_sun) || defined (__sun__)
-			ShowError("%s - '"CL_WHITE"%s"CL_RESET"'\n", strerror(errno), newfile);
-#else
-			char ebuf[255];
-			ShowError("%s - '"CL_WHITE"%s"CL_RESET"'\n", strerror_r(errno, ebuf, sizeof(ebuf)), newfile);
-#endif
-		}
-	}
-	
-	return ret;
-}

+ 0 - 12
src/common/lock.h

@@ -1,12 +0,0 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
-
-#ifndef _LOCK_H_
-#define _LOCK_H_
-
-#include <stdio.h>
-
-FILE* lock_fopen(const char* filename,int *info);
-int   lock_fclose(FILE *fp,const char* filename,int *info);
-
-#endif /* _LOCK_H_ */