mirror of
https://github.com/fumiama/CMoe-Counter.git
synced 2024-11-23 22:00:56 +01:00
fix last user disappear
This commit is contained in:
parent
9729d09da3
commit
5ad5065a44
6
cmoe.c
6
cmoe.c
@ -210,7 +210,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
fp = fdopen(fd, "rb+");
|
||||
return_count(fp, name, theme);
|
||||
fclose(fp);
|
||||
fflush(fp); flock(fd, LOCK_UN); close(fd);
|
||||
return 0;
|
||||
}
|
||||
reg = get_arg(reg + 4);
|
||||
@ -232,13 +232,13 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
fp = fdopen(fd, "rb+");
|
||||
if(name_exist(fp, name)) {
|
||||
fclose(fp);
|
||||
fflush(fp); flock(fd, LOCK_UN); close(fd);
|
||||
http_error(HTTP400, "Name Exist.");
|
||||
return 7;
|
||||
}
|
||||
fseek(fp, 0, SEEK_END);
|
||||
add_user(name, 0, fp);
|
||||
fclose(fp);
|
||||
fflush(fp); flock(fd, LOCK_UN); close(fd);
|
||||
char* msg = "<P>Success.\r\n";
|
||||
if(headers(strlen(msg), "text/html")) {
|
||||
write(1, "\0\0\0\0", 4);
|
||||
|
Loading…
Reference in New Issue
Block a user