1
0
mirror of https://github.com/fumiama/CMoe-Counter.git synced 2024-11-24 06:10:11 +01:00

fix flock fseek

This commit is contained in:
源文雨 2023-06-09 12:47:00 +08:00
parent 09c44e87fb
commit 2187473132

11
cmoe.c
View File

@ -241,16 +241,7 @@ int main(int argc, char **argv) {
http_error(HTTP400, "Name Exist.");
return 7;
}
flease(fp);
fp = fopen(datfile, "ab+");
if (!fp) {
http_error(HTTP500, "Open File Error.");
return -6;
}
if(flock(fileno(fp), LOCK_EX)) {
http_error(HTTP500, "Lock File Error.");
return -7;
}
fseek(fp, 0, SEEK_END);
add_user(name, 0, fp);
flease(fp);
char* msg = "<P>Success.\r\n";