summaryrefslogtreecommitdiffstats
path: root/mbbsd/edit.c
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-11-07 00:25:15 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-11-07 00:25:15 +0800
commit3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a (patch)
tree772cecc4731614e9df09367ab0d5f0f8654be4b4 /mbbsd/edit.c
parent175ba7e7cf70d131d34fd8c09a3138e7f9dfeea0 (diff)
downloadpttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar.gz
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar.bz2
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar.lz
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar.xz
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.tar.zst
pttbbs-3135cf3e37a4b5fbd7b7b4e7a67b66c47d0e1e3a.zip
editlock by flock()
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@558 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/edit.c')
-rw-r--r--mbbsd/edit.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/mbbsd/edit.c b/mbbsd/edit.c
index 8685dfc5..f560167d 100644
--- a/mbbsd/edit.c
+++ b/mbbsd/edit.c
@@ -1,4 +1,4 @@
-/* $Id: edit.c,v 1.20 2002/10/26 03:54:15 in2 Exp $ */
+/* $Id: edit.c,v 1.21 2002/11/06 16:25:15 in2 Exp $ */
#include "bbs.h"
typedef struct textline_t {
struct textline_t *prev;
@@ -2290,39 +2290,3 @@ vedit(char *fpath, int saveheader, int *islocal)
}
}
-void editlock(char *fpath)
-{
- char fn[256];
- FILE *fp;
- snprintf(fn, sizeof(fn), "%s.lock", fpath);
- if( (fp = fopen(fn, "w")) != NULL ){
- fprintf(fp, "%d\n", currpid);
- fclose(fp);
- }
-}
-
-void editunlock(char *fpath)
-{
- char fn[256];
- snprintf(fn, sizeof(fn), "%s.lock", fpath);
- unlink(fn);
-}
-
-int iseditlocking(char *fpath, char *action)
-{
- char fn[256];
- FILE *fp;
- snprintf(fn, sizeof(fn), "%s.lock", fpath);
- if( (fp = fopen(fn, "r")) != NULL ){
- int pid;
- fscanf(fp, "%d", &pid);
- fclose(fp);
- if( kill(pid, 0) >= 0 ){
- vmsg("文章編修中, 暫時無法%s", action);
- return 1;
- }
- else
- unlink(fn);
- }
- return 0;
-}