summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/lock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/lock.c b/src/common/lock.c
index 67001f9..c584017 100644
--- a/src/common/lock.c
+++ b/src/common/lock.c
@@ -1,4 +1,5 @@
+#include <unistd.h>
#include <stdio.h>
#include "lock.h"
#include "socket.h"
@@ -10,12 +11,12 @@
FILE* lock_fopen(const char* filename,int *info) {
char newfile[512];
FILE *fp;
- int no = 0;
+ int no = getpid();
// ���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<99999) );
*info = no;
return fopen_(newfile,"w");
}