summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/log.c24
-rw-r--r--common/os_calls.c15
-rw-r--r--common/os_calls.h1
3 files changed, 17 insertions, 23 deletions
diff --git a/common/log.c b/common/log.c
index ce0000aa..55353a8f 100644
--- a/common/log.c
+++ b/common/log.c
@@ -363,7 +363,7 @@ internal_config_read_logging(int file, struct log_config *lc,
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_ENABLE_SYSLOG))
{
- lc->enable_syslog = text2bool((char *)list_get_item(param_v, i));
+ lc->enable_syslog = g_text2bool((char *)list_get_item(param_v, i));
}
if (0 == g_strcasecmp(buf, SESMAN_CFG_LOG_SYSLOG_LEVEL))
@@ -413,28 +413,6 @@ internalInitAndAllocStruct(void)
* Here below the public functions
*/
-
-/**
- *
- * @brief Reads sesman configuration
- * @param s translates the strings "1", "true" and "yes" in 1 (true) and other strings in 0
- * @return 0 on false, 1 on 1,true, yes
- *
- */
-int APP_CC
-text2bool(char *s)
-{
- if ( (g_atoi(s) != 0) ||
- (0 == g_strcasecmp(s, "true")) ||
- (0 == g_strcasecmp(s, "on")) ||
- (0 == g_strcasecmp(s, "yes")))
- {
- return 1;
- }
-
- return 0;
-}
-
enum logReturns DEFAULT_CC
log_start_from_param(const struct log_config *iniParams)
{
diff --git a/common/os_calls.c b/common/os_calls.c
index f5f5cd60..1939ddc9 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -2935,3 +2935,18 @@ g_time3(void)
return (tp.tv_sec * 1000) + (tp.tv_usec / 1000);
#endif
}
+
+/*****************************************************************************/
+/* returns boolean */
+int APP_CC
+g_text2bool(const char *s)
+{
+ if ( (g_atoi(s) != 0) ||
+ (0 == g_strcasecmp(s, "true")) ||
+ (0 == g_strcasecmp(s, "on")) ||
+ (0 == g_strcasecmp(s, "yes")))
+ {
+ return 1;
+ }
+ return 0;
+}
diff --git a/common/os_calls.h b/common/os_calls.h
index cba37588..2dbbe660 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -152,5 +152,6 @@ int APP_CC g_check_user_in_group(const char* username, int gid, int* ok);
int APP_CC g_time1(void);
int APP_CC g_time2(void);
int APP_CC g_time3(void);
+int APP_CC g_text2bool(const char *s);
#endif