summaryrefslogtreecommitdiffstats
path: root/xrdp
diff options
context:
space:
mode:
authorjsorg71 <jay.sorg@gmail.com>2013-01-17 12:30:17 -0800
committerjsorg71 <jay.sorg@gmail.com>2013-01-17 12:30:17 -0800
commitffc7e7ff270134c7f5c73f8f86cac81038e8fee3 (patch)
treefdb57b1ee4bf75dad7ff3fef60bca09dceafe93a /xrdp
parente632bc794bdafb8ea025396807e107a1e4b751af (diff)
parentbdc678bdc3b986ea91e433d691bb7b963e0d420f (diff)
downloadxrdp-proprietary-ffc7e7ff270134c7f5c73f8f86cac81038e8fee3.tar.gz
xrdp-proprietary-ffc7e7ff270134c7f5c73f8f86cac81038e8fee3.zip
Merge pull request #52 from Osirium/patch/text2bool
Patch/text2bool - use common function when converting string to bool
Diffstat (limited to 'xrdp')
-rw-r--r--xrdp/xrdp_listen.c28
-rw-r--r--xrdp/xrdp_mm.c11
-rw-r--r--xrdp/xrdp_wm.c8
3 files changed, 7 insertions, 40 deletions
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c
index 704fc214..e31c5405 100644
--- a/xrdp/xrdp_listen.c
+++ b/xrdp/xrdp_listen.c
@@ -19,6 +19,7 @@
*/
#include "xrdp.h"
+#include "log.h"
/* 'g_process' is protected by the semaphore 'g_process_sem'. One thread sets
g_process and waits for the other to process it */
@@ -198,40 +199,19 @@ xrdp_listen_get_port_address(char *port, int port_bytes,
if (g_strcasecmp(val, "fork") == 0)
{
val = (char *)list_get_item(values, index);
-
- if ((g_strcasecmp(val, "yes") == 0) ||
- (g_strcasecmp(val, "on") == 0) ||
- (g_strcasecmp(val, "true") == 0) ||
- (g_atoi(val) != 0))
- {
- startup_param->fork = 1;
- }
+ startup_param->fork = text2bool(val);
}
if (g_strcasecmp(val, "tcp_nodelay") == 0)
{
val = (char *)list_get_item(values, index);
-
- if ((g_strcasecmp(val, "yes") == 0) ||
- (g_strcasecmp(val, "on") == 0) ||
- (g_strcasecmp(val, "true") == 0) ||
- (g_atoi(val) != 0))
- {
- *tcp_nodelay = 1 ;
- }
+ *tcp_nodelay = text2bool(val);
}
if (g_strcasecmp(val, "tcp_keepalive") == 0)
{
val = (char *)list_get_item(values, index);
-
- if ((g_strcasecmp(val, "yes") == 0) ||
- (g_strcasecmp(val, "on") == 0) ||
- (g_strcasecmp(val, "true") == 0) ||
- (g_atoi(val) != 0))
- {
- *tcp_keepalive = 1 ;
- }
+ *tcp_keepalive = text2bool(val);
}
}
}
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index fc00678f..52751b72 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -2034,15 +2034,8 @@ is_channel_enabled(char *inName, struct list *names, struct list *values)
if ( index >= 0 )
{
val = (char *)list_get_item(values, index);
-
- if ((g_strcasecmp(val, "yes") == 0) ||
- (g_strcasecmp(val, "on") == 0) ||
- (g_strcasecmp(val, "true") == 0) ||
- (g_atoi(val) != 0))
- {
- reply = 1;
- }
- else
+ reply = text2bool(val);
+ if (reply == 0)
{
g_writeln("This channel is disabled: %s", name);
}
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index 24362f54..0a2600f2 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -444,13 +444,7 @@ xrdp_wm_load_static_colors_plus(struct xrdp_wm *self, char *autorun_name)
else if (g_strcasecmp(val, "hidelogwindow") == 0)
{
val = (char *)list_get_item(values, index);
-
- if ((g_strcasecmp(val, "yes") == 0) ||
- (g_strcasecmp(val, "1") == 0) ||
- (g_strcasecmp(val, "true") == 0))
- {
- self->hide_log_window = 1;
- }
+ self->hide_log_window = text2bool(val);
}
}
}