diff options
| author | LawrenceK <github@lklyne.co.uk> | 2013-01-16 13:41:57 +0000 |
|---|---|---|
| committer | LawrenceK <github@lklyne.co.uk> | 2013-01-17 11:31:01 +0000 |
| commit | 266db3150bfbfd8315416ba484a2e3d59b6e322d (patch) | |
| tree | fdb57b1ee4bf75dad7ff3fef60bca09dceafe93a /xrdp/xrdp_listen.c | |
| parent | e47a9cea97085a5b693bd2c9e6539bda38fa9927 (diff) | |
| download | xrdp-proprietary-266db3150bfbfd8315416ba484a2e3d59b6e322d.tar.gz xrdp-proprietary-266db3150bfbfd8315416ba484a2e3d59b6e322d.zip | |
refactor and use test2bool instead of duplicated code testing for on,yes,true, non zero
Diffstat (limited to 'xrdp/xrdp_listen.c')
| -rw-r--r-- | xrdp/xrdp_listen.c | 28 |
1 files changed, 4 insertions, 24 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); } } } |
