diff options
author | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-10-02 09:25:30 +0800 |
---|---|---|
committer | victor <victor@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2004-10-02 09:25:30 +0800 |
commit | 0fcf591ff42a089e8641aba900866b2708731bf3 (patch) | |
tree | af8321d21dc8f65aee8416206036b8ced5835ecb | |
parent | 316ea947ba533be41523eda9c0c112405ec4a086 (diff) | |
download | pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar.gz pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar.bz2 pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar.lz pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar.xz pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.tar.zst pttbbs-0fcf591ff42a089e8641aba900866b2708731bf3.zip |
create the file if not exist
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2218 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/gamble.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/mbbsd/gamble.c b/mbbsd/gamble.c index 0566861a..e752debd 100644 --- a/mbbsd/gamble.c +++ b/mbbsd/gamble.c @@ -106,6 +106,11 @@ append_ticket_record(char *direct, int ch, int n, int count) } snprintf(genbuf, sizeof(genbuf), "%s/" FN_TICKET_RECORD, direct); + + if (!dashf(genbuf)) { + creat(genbuf, S_IRUSR | S_IWUSR); + } + if ((fp = fopen(genbuf, "r+"))) { flock(fileno(fp), LOCK_EX); |