summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authordaixj <daixj@shterm.com>2018-01-29 15:21:40 +0800
committermetalefty <meta@vmeta.jp>2018-02-13 16:44:37 +0900
commitea6bb62410aef141f67225c3eac3b03cae285030 (patch)
treebea6760931eae5591ccac464c45222ff3f3b85de /common
parent551bb185c55ab084b85677d0f23a8ed258328575 (diff)
downloadxrdp-proprietary-ea6bb62410aef141f67225c3eac3b03cae285030.tar.gz
xrdp-proprietary-ea6bb62410aef141f67225c3eac3b03cae285030.zip
log: fix fd checking
Diffstat (limited to 'common')
-rwxr-xr-xcommon/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/log.c b/common/log.c
index 0bf013e3..50a44e9e 100755
--- a/common/log.c
+++ b/common/log.c
@@ -331,7 +331,7 @@ internal_config_read_logging(int file, struct log_config *lc,
/* setting defaults */
lc->program_name = applicationName;
lc->log_file = 0;
- lc->fd = 0;
+ lc->fd = -1;
lc->log_level = LOG_LEVEL_DEBUG;
lc->enable_syslog = 0;
lc->syslog_level = LOG_LEVEL_DEBUG;
@@ -604,7 +604,7 @@ log_message(const enum logLevels lvl, const char *msg, ...)
pthread_mutex_lock(&(g_staticLogConfig->log_lock));
#endif
- if (g_staticLogConfig->fd > 0)
+ if (g_staticLogConfig->fd >= 0)
{
writereply = g_file_write(g_staticLogConfig->fd, buff, g_strlen(buff));