diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:52:08 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:55:31 +0200 |
commit | 4673fd3ca06010e74f8223486b0f34e58c7b0a7e (patch) | |
tree | cfcc97752fd770eb1befa295e16f7aa4a2607ca9 /src/common/lock.c | |
parent | 03b5e644857f80a23bd8b856b78a10cf0a564a66 (diff) | |
download | tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.gz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.bz2 tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.xz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.zip |
Fixes to socket system to make it cope better with fd depletion.
Also added timeout for fullconnect, secured map server from stateless
connections.
Diffstat (limited to 'src/common/lock.c')
-rw-r--r-- | src/common/lock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/lock.c b/src/common/lock.c index 9a2205b..67001f9 100644 --- a/src/common/lock.c +++ b/src/common/lock.c @@ -1,6 +1,7 @@ #include <stdio.h> #include "lock.h" +#include "socket.h" // �������݃t�@�C���̕ی쏈�� // �i�������݂��I���܂ŁA���t�@�C����ۊǂ��Ă����j @@ -14,9 +15,9 @@ FILE* lock_fopen(const char* filename,int *info) { // ���S�ȃt�@�C������i�蔲���j do { sprintf(newfile,"%s_%04d.tmp",filename,++no); - } while((fp = fopen(newfile,"r")) && (fclose(fp), no<9999) ); + } while((fp = fopen_(newfile,"r")) && (fclose_(fp), no<9999) ); *info = no; - return fopen(newfile,"w"); + return fopen_(newfile,"w"); } // ���t�@�C�����폜���V�t�@�C�������l�[�� @@ -24,7 +25,7 @@ int lock_fclose(FILE *fp,const char* filename,int *info) { int ret = 0; char newfile[512]; if(fp != NULL) { - ret = fclose(fp); + ret = fclose_(fp); sprintf(newfile,"%s_%04d.tmp",filename,*info); remove(filename); // ���̃^�C�~���O�ŗ�����ƍň��B |