From 37b4a14b5472eaeb1650e915b7b302d1d7d1adf2 Mon Sep 17 00:00:00 2001 From: volth Date: Wed, 4 Jan 2017 12:54:55 +0000 Subject: [PATCH 1/2] fix build with --enable-xrdpdebug=yes --- common/Makefile.am | 6 ++++++ common/log.h | 1 + mc/Makefile.am | 6 ++++++ sesman/Makefile.am | 6 ++++++ sesman/chansrv/Makefile.am | 6 ++++++ sesman/libscp/Makefile.am | 6 ++++++ sesman/scp.c | 4 ++-- sesman/sig.c | 10 +++++----- sesman/tools/Makefile.am | 6 ++++++ vnc/Makefile.am | 6 ++++++ vnc/vnc.c | 1 - xup/Makefile.am | 6 ++++++ 12 files changed, 56 insertions(+), 8 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 1bc5851f..15466c9a 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -18,6 +18,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -DXRDP_LOG_PATH=\"${localstatedir}/log\" +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + AM_CFLAGS = $(OPENSSL_CFLAGS) module_LTLIBRARIES = \ diff --git a/common/log.h b/common/log.h index 33bb41fd..d6a5b8f2 100644 --- a/common/log.h +++ b/common/log.h @@ -22,6 +22,7 @@ #include #include "arch.h" +#include "defines.h" /* logging buffer size */ #define LOG_BUFFER_SIZE 1024 diff --git a/mc/Makefile.am b/mc/Makefile.am index e705ff0d..eebef8c3 100644 --- a/mc/Makefile.am +++ b/mc/Makefile.am @@ -5,6 +5,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + module_LTLIBRARIES = \ libmc.la diff --git a/sesman/Makefile.am b/sesman/Makefile.am index 89b99f54..0cf419da 100644 --- a/sesman/Makefile.am +++ b/sesman/Makefile.am @@ -9,6 +9,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + if SESMAN_NOPAM AUTH_C = verify_user.c AUTH_LIB = -lcrypt diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index 7a2672a8..d89b96fb 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -11,6 +11,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + CHANSRV_EXTRA_LIBS = if XRDP_FUSE diff --git a/sesman/libscp/Makefile.am b/sesman/libscp/Makefile.am index 1bb89910..ea4bdd42 100644 --- a/sesman/libscp/Makefile.am +++ b/sesman/libscp/Makefile.am @@ -5,6 +5,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + module_LTLIBRARIES = \ libscp.la diff --git a/sesman/scp.c b/sesman/scp.c index d81de0ab..89176dcb 100644 --- a/sesman/scp.c +++ b/sesman/scp.c @@ -54,12 +54,12 @@ scp_process_start(void *sck) if (sdata->version == 0) { /* starts processing an scp v0 connection */ - LOG_DBG("accept ok, go on with scp v0", 0); + LOG_DBG("accept ok, go on with scp v0"); scp_v0_process(&scon, sdata); } else { - LOG_DBG("accept ok, go on with scp v1", 0); + LOG_DBG("accept ok, go on with scp v1"); /*LOG_DBG("user: %s\npass: %s",sdata->username, sdata->password);*/ scp_v1_process(&scon, sdata); } diff --git a/sesman/sig.c b/sesman/sig.c index 579b5876..aeb3aa90 100644 --- a/sesman/sig.c +++ b/sesman/sig.c @@ -167,7 +167,7 @@ sig_handler_thread(void *arg) do { - LOG_DBG(&(g_cfg->log), "calling sigwait()", 0); + LOG_DBG("calling sigwait()"); sigwait(&waitmask, &recv_signal); switch (recv_signal) @@ -175,22 +175,22 @@ sig_handler_thread(void *arg) case SIGHUP: //reload cfg //we must stop & restart logging, or copy logging cfg!!!! - LOG_DBG("sesman received SIGHUP", 0); + LOG_DBG("sesman received SIGHUP"); //return 0; break; case SIGCHLD: /* a session died */ - LOG_DBG("sesman received SIGCHLD", 0); + LOG_DBG("sesman received SIGCHLD"); sig_sesman_session_end(SIGCHLD); break; case SIGINT: /* we die */ - LOG_DBG("sesman received SIGINT", 0); + LOG_DBG("sesman received SIGINT"); sig_sesman_shutdown(recv_signal); break; case SIGTERM: /* we die */ - LOG_DBG("sesman received SIGTERM", 0); + LOG_DBG("sesman received SIGTERM"); sig_sesman_shutdown(recv_signal); break; } diff --git a/sesman/tools/Makefile.am b/sesman/tools/Makefile.am index 44bf068b..7f27f8b1 100644 --- a/sesman/tools/Makefile.am +++ b/sesman/tools/Makefile.am @@ -7,6 +7,12 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/sesman/libscp \ -I$(top_srcdir)/sesman +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + AM_CFLAGS = $(X_CFLAGS) bin_PROGRAMS = \ diff --git a/vnc/Makefile.am b/vnc/Makefile.am index 453022f4..fc0f8385 100644 --- a/vnc/Makefile.am +++ b/vnc/Makefile.am @@ -5,6 +5,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + module_LTLIBRARIES = \ libvnc.la diff --git a/vnc/vnc.c b/vnc/vnc.c index 3a91ea9d..1b1ae269 100644 --- a/vnc/vnc.c +++ b/vnc/vnc.c @@ -1388,7 +1388,6 @@ lib_mod_connect(struct vnc *v) trans_delete(v->trans); v->trans = 0; v->server_msg(v, "some problem", 0); - LIB_DEBUG(mod, "out lib_mod_connect error"); return 1; } else diff --git a/xup/Makefile.am b/xup/Makefile.am index cdaca15c..2a4fa0df 100644 --- a/xup/Makefile.am +++ b/xup/Makefile.am @@ -5,6 +5,12 @@ AM_CPPFLAGS = \ -DXRDP_PID_PATH=\"${localstatedir}/run\" \ -I$(top_srcdir)/common +if XRDP_DEBUG +AM_CPPFLAGS += -DXRDP_DEBUG +else +AM_CPPFLAGS += -DXRDP_NODEBUG +endif + module_LTLIBRARIES = \ libxup.la From 26a26ef906be8569abcabb710fabf46fff9e54e1 Mon Sep 17 00:00:00 2001 From: volth Date: Wed, 4 Jan 2017 19:13:49 +0000 Subject: [PATCH 2/2] fix build with --enable-xrdpdebug=yes --- common/Makefile.am | 2 -- common/log.h | 3 +-- common/pixman-region.c | 2 +- libxrdp/Makefile.am | 2 -- mc/Makefile.am | 2 -- neutrinordp/Makefile.am | 2 -- rdp/Makefile.am | 2 -- sesman/Makefile.am | 2 -- sesman/chansrv/Makefile.am | 2 -- sesman/libscp/Makefile.am | 2 -- sesman/tools/Makefile.am | 2 -- vnc/Makefile.am | 2 -- xrdp/Makefile.am | 2 -- xup/Makefile.am | 2 -- 14 files changed, 2 insertions(+), 27 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 15466c9a..0af033a3 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -20,8 +20,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif AM_CFLAGS = $(OPENSSL_CFLAGS) diff --git a/common/log.h b/common/log.h index d6a5b8f2..d1552ccb 100644 --- a/common/log.h +++ b/common/log.h @@ -22,7 +22,6 @@ #include #include "arch.h" -#include "defines.h" /* logging buffer size */ #define LOG_BUFFER_SIZE 1024 @@ -58,7 +57,7 @@ enum logReturns /* enable threading */ /*#define LOG_ENABLE_THREAD*/ -#ifdef DEBUG +#ifdef XRDP_DEBUG #define LOG_DBG(args...) log_message(LOG_LEVEL_DEBUG, args); #else #define LOG_DBG(args...) diff --git a/common/pixman-region.c b/common/pixman-region.c index b1949950..2d199de8 100644 --- a/common/pixman-region.c +++ b/common/pixman-region.c @@ -79,7 +79,7 @@ #define GOOD_RECT(rect) ((rect)->x1 < (rect)->x2 && (rect)->y1 < (rect)->y2) #define BAD_RECT(rect) ((rect)->x1 > (rect)->x2 || (rect)->y1 > (rect)->y2) -#ifdef DEBUG +#ifdef XRDP_DEBUG #define GOOD(reg) \ do \ diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am index 0452c1da..3812de9c 100644 --- a/libxrdp/Makefile.am +++ b/libxrdp/Makefile.am @@ -14,8 +14,6 @@ LIBXRDP_EXTRA_LIBS = if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif if XRDP_NEUTRINORDP diff --git a/mc/Makefile.am b/mc/Makefile.am index eebef8c3..2171a180 100644 --- a/mc/Makefile.am +++ b/mc/Makefile.am @@ -7,8 +7,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \ diff --git a/neutrinordp/Makefile.am b/neutrinordp/Makefile.am index fb5bf030..e15dacc6 100644 --- a/neutrinordp/Makefile.am +++ b/neutrinordp/Makefile.am @@ -8,8 +8,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \ diff --git a/rdp/Makefile.am b/rdp/Makefile.am index 30368156..6b649aab 100644 --- a/rdp/Makefile.am +++ b/rdp/Makefile.am @@ -7,8 +7,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \ diff --git a/sesman/Makefile.am b/sesman/Makefile.am index 0cf419da..207890ac 100644 --- a/sesman/Makefile.am +++ b/sesman/Makefile.am @@ -11,8 +11,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif if SESMAN_NOPAM diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index d89b96fb..05ca50f5 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -13,8 +13,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif CHANSRV_EXTRA_LIBS = diff --git a/sesman/libscp/Makefile.am b/sesman/libscp/Makefile.am index ea4bdd42..fc382b43 100644 --- a/sesman/libscp/Makefile.am +++ b/sesman/libscp/Makefile.am @@ -7,8 +7,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \ diff --git a/sesman/tools/Makefile.am b/sesman/tools/Makefile.am index 7f27f8b1..9d6d6f9e 100644 --- a/sesman/tools/Makefile.am +++ b/sesman/tools/Makefile.am @@ -9,8 +9,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif AM_CFLAGS = $(X_CFLAGS) diff --git a/vnc/Makefile.am b/vnc/Makefile.am index fc0f8385..80e486c3 100644 --- a/vnc/Makefile.am +++ b/vnc/Makefile.am @@ -7,8 +7,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \ diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am index f39610a0..3765f203 100644 --- a/xrdp/Makefile.am +++ b/xrdp/Makefile.am @@ -17,8 +17,6 @@ XRDP_EXTRA_LIBS = if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif if XRDP_RFXCODEC diff --git a/xup/Makefile.am b/xup/Makefile.am index 2a4fa0df..76fc016a 100644 --- a/xup/Makefile.am +++ b/xup/Makefile.am @@ -7,8 +7,6 @@ AM_CPPFLAGS = \ if XRDP_DEBUG AM_CPPFLAGS += -DXRDP_DEBUG -else -AM_CPPFLAGS += -DXRDP_NODEBUG endif module_LTLIBRARIES = \