summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-08-06 13:21:01 -0700
committerJay Sorg <jay.sorg@gmail.com>2014-08-06 13:21:01 -0700
commit8397055e8b412d58df84172fd6d883f7fe5b6906 (patch)
tree1f574323964fab8d3525cb0fb247c5496bbc23c5
parente4d054654f30ad8be900e72e1f943f93baf1809c (diff)
downloadxrdp-proprietary-8397055e8b412d58df84172fd6d883f7fe5b6906.tar.gz
xrdp-proprietary-8397055e8b412d58df84172fd6d883f7fe5b6906.zip
move some hard code paths to defines in header
-rw-r--r--common/file_loc.h20
-rw-r--r--sesman/chansrv/chansrv.c5
-rw-r--r--sesman/chansrv/sound.c4
-rw-r--r--xrdp/xrdp_mm.c4
4 files changed, 25 insertions, 8 deletions
diff --git a/common/file_loc.h b/common/file_loc.h
index 3b408e43..7389a1ed 100644
--- a/common/file_loc.h
+++ b/common/file_loc.h
@@ -45,4 +45,24 @@
#define XRDP_LOG_PATH "/var/log"
#endif
+#if !defined(XRDP_CHANSRV_STR)
+#define XRDP_CHANSRV_STR "/tmp/.xrdp/xrdp_chansrv_socket_%d"
+#endif
+
+#if !defined(CHANSRV_PORT_OUT_STR)
+#define CHANSRV_PORT_OUT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d"
+#endif
+
+#if !defined(CHANSRV_PORT_IN_STR)
+#define CHANSRV_PORT_IN_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
+#endif
+
+#if !defined(CHANSRV_API_STR)
+#define CHANSRV_API_STR "/tmp/.xrdp/xrdpapi_%d"
+#endif
+
+#if !defined(XRDP_X11RDP_STR)
+#define XRDP_X11RDP_STR "/tmp/.xrdp/xrdp_display_%d"
+#endif
+
#endif
diff --git a/sesman/chansrv/chansrv.c b/sesman/chansrv/chansrv.c
index 21fc6a6d..9dff1688 100644
--- a/sesman/chansrv/chansrv.c
+++ b/sesman/chansrv/chansrv.c
@@ -1013,8 +1013,7 @@ setup_listen(void)
{
g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
g_lis_trans->is_term = g_is_term;
- g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d",
- 7200 + g_display_num);
+ g_snprintf(port, 255, XRDP_CHANSRV_STR, g_display_num);
}
else
{
@@ -1045,7 +1044,7 @@ setup_api_listen(void)
g_api_lis_trans = trans_create(TRANS_MODE_UNIX, 8192 * 4, 8192 * 4);
g_api_lis_trans->is_term = g_is_term;
- g_snprintf(port, 255, "/tmp/.xrdp/xrdpapi_%d", g_display_num);
+ g_snprintf(port, 255, CHANSRV_API_STR, g_display_num);
g_api_lis_trans->trans_conn_in = my_api_trans_conn_in;
error = trans_listen(g_api_lis_trans, port);
diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c
index 08ae7c6b..48bb871e 100644
--- a/sesman/chansrv/sound.c
+++ b/sesman/chansrv/sound.c
@@ -27,6 +27,7 @@
#include "thread_calls.h"
#include "defines.h"
#include "fifo.h"
+#include "file_loc.h"
extern int g_rdpsnd_chan_id; /* in chansrv.c */
extern int g_display_num; /* in chansrv.c */
@@ -52,9 +53,6 @@ int g_buf_index = 0;
int g_sent_time[256];
int g_sent_flag[256];
-#define CHANSRV_PORT_OUT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d"
-#define CHANSRV_PORT_IN_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
-
struct xr_wave_format_ex
{
int wFormatTag;
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 3f688662..179a44e7 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -549,7 +549,7 @@ xrdp_mm_setup_mod2(struct xrdp_mm *self)
if (use_uds)
{
- g_snprintf(text, 255, "/tmp/.xrdp/xrdp_display_%d", self->display);
+ g_snprintf(text, 255, XRDP_X11RDP_STR, self->display);
}
else
{
@@ -1233,7 +1233,7 @@ xrdp_mm_process_login_response(struct xrdp_mm *self, struct stream *s)
/* connect channel redir */
if ((g_strcmp(ip, "127.0.0.1") == 0) || (ip[0] == 0))
{
- g_snprintf(port, 255, "/tmp/.xrdp/xrdp_chansrv_socket_%d", 7200 + display);
+ g_snprintf(port, 255, XRDP_CHANSRV_STR, display);
}
else
{