diff options
author | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:52:08 +0200 |
---|---|---|
committer | Dennis Friis <peavey@inspircd.org> | 2009-07-07 00:55:31 +0200 |
commit | 4673fd3ca06010e74f8223486b0f34e58c7b0a7e (patch) | |
tree | cfcc97752fd770eb1befa295e16f7aa4a2607ca9 /src/map/atcommand.c | |
parent | 03b5e644857f80a23bd8b856b78a10cf0a564a66 (diff) | |
download | tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.gz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.bz2 tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.tar.xz tmwa-4673fd3ca06010e74f8223486b0f34e58c7b0a7e.zip |
Fixes to socket system to make it cope better with fd depletion.
Also added timeout for fullconnect, secured map server from stateless
connections.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 6536e00..eb37561 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -574,9 +574,9 @@ void log_atcommand(struct map_session_data *sd, const char *fmt, ...) sprintf(fullname, "%s.%04d-%02d", gm_logfile_name, year, month); if (gm_logfile) - fclose(gm_logfile); + fclose_(gm_logfile); - gm_logfile = fopen(fullname, "a"); + gm_logfile = fopen_(fullname, "a"); free(fullname); if (!gm_logfile) { @@ -729,7 +729,7 @@ int msg_config_read(const char *cfgName) { char line[1024], w1[1024], w2[1024]; FILE *fp; - if ((fp = fopen(cfgName, "r")) == NULL) { + if ((fp = fopen_(cfgName, "r")) == NULL) { printf("Messages file not found: %s\n", cfgName); return 1; } @@ -748,7 +748,7 @@ int msg_config_read(const char *cfgName) { } } } - fclose(fp); + fclose_(fp); return 0; } @@ -776,7 +776,7 @@ int atcommand_config_read(const char *cfgName) { AtCommandInfo* p; FILE* fp; - if ((fp = fopen(cfgName, "r")) == NULL) { + if ((fp = fopen_(cfgName, "r")) == NULL) { printf("At commands configuration file not found: %s\n", cfgName); return 1; } @@ -803,7 +803,7 @@ int atcommand_config_read(const char *cfgName) { w2[0] != '%') // symbol of party chat speaking command_symbol = w2[0]; } - fclose(fp); + fclose_(fp); return 0; } @@ -1934,7 +1934,7 @@ int atcommand_help( memset(buf, '\0', sizeof(buf)); - if ((fp = fopen(help_txt, "r")) != NULL) { + if ((fp = fopen_(help_txt, "r")) != NULL) { clif_displaymessage(fd, msg_table[26]); // Help commands: gm_level = pc_isGM(sd); while(fgets(buf, sizeof(buf) - 1, fp) != NULL) { @@ -1951,7 +1951,7 @@ int atcommand_help( else if (gm_level >= atoi(w1)) clif_displaymessage(fd, w2); } - fclose(fp); + fclose_(fp); } else { clif_displaymessage(fd, msg_table[27]); // File help.txt not found. return -1; |