Fix the message counter
This commit is contained in:
parent
c73cc11d7f
commit
d631f22702
@ -81,7 +81,7 @@ unsigned long generate_msgid() {
|
|||||||
|
|
||||||
snprintf(buffer, 1024, "%s/msgserial", conf.bbs_path);
|
snprintf(buffer, 1024, "%s/msgserial", conf.bbs_path);
|
||||||
|
|
||||||
fptr = fopen(buffer, "rw");
|
fptr = fopen(buffer, "r+");
|
||||||
if (fptr) {
|
if (fptr) {
|
||||||
flock(fileno(fptr), LOCK_EX);
|
flock(fileno(fptr), LOCK_EX);
|
||||||
fread(&lastread, sizeof(time_t), 1, fptr);
|
fread(&lastread, sizeof(time_t), 1, fptr);
|
||||||
|
@ -172,7 +172,7 @@ unsigned long generate_msgid(char *bbs_path) {
|
|||||||
|
|
||||||
snprintf(buffer, 1024, "%s/msgserial", bbs_path);
|
snprintf(buffer, 1024, "%s/msgserial", bbs_path);
|
||||||
|
|
||||||
fptr = fopen(buffer, "rw");
|
fptr = fopen(buffer, "r+");
|
||||||
if (fptr) {
|
if (fptr) {
|
||||||
flock(fileno(fptr), LOCK_EX);
|
flock(fileno(fptr), LOCK_EX);
|
||||||
fread(&lastread, sizeof(time_t), 1, fptr);
|
fread(&lastread, sizeof(time_t), 1, fptr);
|
||||||
|
Reference in New Issue
Block a user