This just convert non thread safe calls to thread safe ones.

-Angus

Signed-off-by: Angus Salkeld <asalk...@redhat.com>
---
 exec/main.c     |    5 +++--
 lib/sa-confdb.c |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/exec/main.c b/exec/main.c
index 3f3ec87..eb135e6 100644
--- a/exec/main.c
+++ b/exec/main.c
@@ -1242,6 +1242,7 @@ int main (int argc, char **argv)
        const char *config_iface_init;
        char *config_iface;
        char *iface;
+       char *strtok_save_pt;
        int res, ch;
        int background, setprio;
        struct stat stat_out;
@@ -1349,7 +1350,7 @@ int main (int argc, char **argv)
                corosync_exit_error (AIS_DONE_OBJDB);
        }
 
-       iface = strtok(config_iface, ":");
+       iface = strtok_r(config_iface, ":", &strtok_save_pt);
        while (iface)
        {
                res = lcr_ifact_reference (
@@ -1373,7 +1374,7 @@ int main (int argc, char **argv)
                log_printf (LOGSYS_LEVEL_NOTICE, "%s", error_string);
                config_modules[num_config_modules++] = config;
 
-               iface = strtok(NULL, ":");
+               iface = strtok_r(NULL, ":", &strtok_save_pt);
        }
        free(config_iface);
 
diff --git a/lib/sa-confdb.c b/lib/sa-confdb.c
index 712df9d..0a71115 100644
--- a/lib/sa-confdb.c
+++ b/lib/sa-confdb.c
@@ -97,6 +97,7 @@ static int load_config(void)
        void *config_p;
        struct config_iface_ver0 *config;
        const char *error_string;
+       char *strtok_savept;
 
        /* User's bootstrap config service */
        config_iface = getenv("COROSYNC_DEFAULT_CONFIG_IFACE");
@@ -111,7 +112,7 @@ static int load_config(void)
                return -1;
        }
 
-       iface = strtok(config_iface, ":");
+       iface = strtok_r (config_iface, ":", &strtok_savept);
        while (iface)
        {
                res = lcr_ifact_reference (
@@ -133,7 +134,7 @@ static int load_config(void)
 
                config_modules[num_config_modules++] = config;
 
-               iface = strtok(NULL, ":");
+               iface = strtok_r (NULL, ":", &strtok_savept);
        }
        free(config_iface);
 
-- 
1.6.6.1


_______________________________________________
Openais mailing list
Openais@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to