Fix the message counter

This commit is contained in:
Andrew Pamment 2016-12-04 18:06:20 +10:00
parent c73cc11d7f
commit d631f22702
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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);