diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2012-06-04 01:11:16 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2012-06-04 01:11:16 -0700 |
commit | 5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492 (patch) | |
tree | a47661f16bcd913652a2a6d671e71884a79046f8 /xrdp/xrdp.c | |
parent | af1b96b3d2dd4c7fb3d15b278e2fbbb6bcc9065e (diff) | |
parent | 4d4ebbf3632bed609b41a9d36969c08d36791417 (diff) | |
download | xrdp-proprietary-5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492.tar.gz xrdp-proprietary-5cd7e29a9fa69c8b1b6c3a3ca8ebf8a9966a2492.zip |
Merge remote branch 'syslog3/syslog3'
Diffstat (limited to 'xrdp/xrdp.c')
-rw-r--r-- | xrdp/xrdp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 95936cef..83d2f0a2 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -21,6 +21,7 @@ */ #include "xrdp.h" +#include "log.h" static struct xrdp_listen* g_listen = 0; static long g_threadid = 0; /* main threadid */ @@ -261,6 +262,8 @@ main(int argc, char** argv) { int test; int host_be; + char cfg_file[256]; + enum logReturns error; struct xrdp_startup_params* startup_params; int pid; int fd; @@ -304,6 +307,25 @@ main(int argc, char** argv) g_writeln("unusable tui64 size, must be 8"); return 0; } + g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); + + /* starting logging subsystem */ + error = log_start(cfg_file,"XRDP"); + + if (error != LOG_STARTUP_OK) + { + char buf[256] ; + switch (error) + { + case LOG_ERROR_MALLOC: + g_printf("error on malloc. cannot start logging. quitting.\n"); + break; + case LOG_ERROR_FILE_OPEN: + g_printf("error opening log file [%s]. quitting.\n", getLogFile(buf,255)); + break; + } + g_exit(1); + } startup_params = (struct xrdp_startup_params*) g_malloc(sizeof(struct xrdp_startup_params), 1); |