Revision: 2819
http://tmux.svn.sourceforge.net/tmux/?rev=2819&view=rev
Author: nicm
Date: 2012-05-30 15:01:57 +0000 (Wed, 30 May 2012)
Log Message:
-----------
Do not use stderr for log file and don't call log_close when not needed.
Modified Paths:
--------------
trunk/log.c
trunk/tmux.c
Modified: trunk/log.c
===================================================================
--- trunk/log.c 2012-05-30 13:49:45 UTC (rev 2818)
+++ trunk/log.c 2012-05-30 15:01:57 UTC (rev 2819)
@@ -28,7 +28,7 @@
#include "tmux.h"
/* Log file, if needed. */
-FILE *log_file = stderr;
+FILE *log_file;
/* Debug level. */
int log_level = 0;
@@ -63,7 +63,7 @@
void
log_close(void)
{
- if (log_file != stderr)
+ if (log_file != NULL)
fclose(log_file);
event_set_log_callback(NULL);
@@ -75,6 +75,9 @@
{
char *fmt;
+ if (log_file == NULL)
+ return;
+
if (asprintf(&fmt, "%s\n", msg) == -1)
exit(1);
if (vfprintf(log_file, fmt, ap) == -1)
Modified: trunk/tmux.c
===================================================================
--- trunk/tmux.c 2012-05-30 13:49:45 UTC (rev 2818)
+++ trunk/tmux.c 2012-05-30 15:01:57 UTC (rev 2819)
@@ -73,7 +73,6 @@
{
char *path;
- log_close();
if (debug_level > 0) {
xasprintf(&path, "tmux-%s-%ld.log", name, (long) getpid());
log_open(debug_level, path);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs