summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-02-19 22:04:31 +0200
committerunknown <monty@mysql.com>2004-02-19 22:04:31 +0200
commit68242939d818cf5d091d5dcf13e312994f423f9f (patch)
treeee35dca9ef62332db78569be7002fc980ec60ea7 /sql/log.cc
parenta01a3dd5ef15be9bd6b5b087491d3e676e88c29c (diff)
downloadmariadb-git-68242939d818cf5d091d5dcf13e312994f423f9f.tar.gz
Fixed usage of strxnmov() in recent changesets
libmysql/libmysql.c: szPipeName -> pipe_name fixed usage of strxnmov() mysys/mf_tempfile.c: Fixed usage of strnxmov() Simple optimization mysys/my_tempnam.c: Fixed usage of strnxmov() Simple optimization sql/log.cc: simple optimization sql/mini_client.cc: szPipeName -> pipe_name fixed usage of strxnmov() sql/mysqld.cc: szPipeName -> pipe_name fixed usage of strxnmov() Fixed indentation
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/sql/log.cc b/sql/log.cc
index c73673d3552..559d30f28ba 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -231,18 +231,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
}
case LOG_NEW:
{
+ uint len;
time_t skr=time(NULL);
struct tm tm_tmp;
+
localtime_r(&skr,&tm_tmp);
- my_snprintf(buff,sizeof(buff),"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
- my_progname,server_version,
- tm_tmp.tm_year % 100,
- tm_tmp.tm_mon+1,
- tm_tmp.tm_mday,
- tm_tmp.tm_hour,
- tm_tmp.tm_min,
- tm_tmp.tm_sec);
- if (my_b_write(&log_file, (byte*) buff,(uint) strlen(buff)) ||
+ len= my_snprintf(buff,sizeof(buff),
+ "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
+ my_progname,server_version,
+ tm_tmp.tm_year % 100,
+ tm_tmp.tm_mon+1,
+ tm_tmp.tm_mday,
+ tm_tmp.tm_hour,
+ tm_tmp.tm_min,
+ tm_tmp.tm_sec);
+ if (my_b_write(&log_file, (byte*) buff, len) ||
flush_io_cache(&log_file))
goto err;
break;