forked from metin2/server
Rewrote network stack, started working on porting to 64-bit
This commit is contained in:
@ -126,7 +126,7 @@ void _sys_err(const char *func, int line, const char *format, ...)
|
||||
return;
|
||||
|
||||
time_s[strlen(time_s) - 1] = '\0';
|
||||
len = snprintf(buf, 1024, "SYSERR: %-15.15s.%d :: %s: ", time_s + 4, tv.tv_usec, func);
|
||||
len = snprintf(buf, 1024, "SYSERR: %-15.15s.%ld :: %s: ", time_s + 4, tv.tv_usec, func);
|
||||
buf[1025] = '\0';
|
||||
|
||||
if (len < 1024)
|
||||
@ -211,7 +211,7 @@ void sys_log(unsigned int bit, const char *format, ...)
|
||||
fprintf(log_file_sys->fp, sys_log_header_string);
|
||||
|
||||
time_s[strlen(time_s) - 1] = '\0';
|
||||
fprintf(log_file_sys->fp, "%-15.15s.%d :: ", time_s + 4, tv.tv_usec );
|
||||
fprintf(log_file_sys->fp, "%-15.15s.%ld :: ", time_s + 4, tv.tv_usec );
|
||||
|
||||
va_start(args, format);
|
||||
vfprintf(log_file_sys->fp, format, args);
|
||||
@ -403,8 +403,8 @@ void log_file_rotate(LPLOGFILE logfile)
|
||||
{
|
||||
struct tm curr_tm;
|
||||
time_t time_s;
|
||||
char dir[128];
|
||||
char system_cmd[128];
|
||||
char dir[256];
|
||||
char system_cmd[256];
|
||||
|
||||
time_s = time(0);
|
||||
curr_tm = *localtime(&time_s);
|
||||
@ -429,7 +429,7 @@ void log_file_rotate(LPLOGFILE logfile)
|
||||
if (curr_tm.tm_hour != logfile->last_hour)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
snprintf(dir, 128, "%s/%04d%02d%02d", log_dir, curr_tm.tm_year + 1900, curr_tm.tm_mon + 1, curr_tm.tm_mday);
|
||||
snprintf(dir, sizeof(dir), "%s/%04d%02d%02d", log_dir, curr_tm.tm_year + 1900, curr_tm.tm_mon + 1, curr_tm.tm_mday);
|
||||
|
||||
if (stat(dir, &stat_buf) != 0 || S_ISDIR(stat_buf.st_mode))
|
||||
{
|
||||
@ -448,9 +448,9 @@ void log_file_rotate(LPLOGFILE logfile)
|
||||
|
||||
// <20>ű<EFBFBD><C5B1><EFBFBD>.
|
||||
#ifndef __WIN32__
|
||||
snprintf(system_cmd, 128, "mv %s %s/%s.%02d", logfile->filename, dir, logfile->filename, logfile->last_hour);
|
||||
snprintf(system_cmd, sizeof(system_cmd), "mv %s %s/%s.%02d", logfile->filename, dir, logfile->filename, logfile->last_hour);
|
||||
#else
|
||||
snprintf(system_cmd, 128, "move %s %s\\%s.%02d", logfile->filename, dir, logfile->filename, logfile->last_hour);
|
||||
snprintf(system_cmd, sizeof(system_cmd), "move %s %s\\%s.%02d", logfile->filename, dir, logfile->filename, logfile->last_hour);
|
||||
#endif
|
||||
system(system_cmd);
|
||||
|
||||
|
Reference in New Issue
Block a user