Imported Upstream version 1.29
[platform/upstream/connman.git] / src / config.c
index 93a788a..a4c117e 100644 (file)
@@ -891,7 +891,7 @@ static void config_notify_handler(struct inotify_event *event,
                return;
        }
 
-       if (event->mask & IN_CREATE)
+       if (event->mask & IN_CREATE || event->mask & IN_MOVED_TO)
                create_config(ident);
 
        if (event->mask & IN_MODIFY) {
@@ -1435,12 +1435,14 @@ static void generate_random_string(char *str, int length)
 {
        uint8_t val;
        int i;
+       uint64_t rand;
 
        memset(str, '\0', length);
 
        for (i = 0; i < length-1; i++) {
                do {
-                       val = (uint8_t)(random() % 122);
+                       __connman_util_get_random(&rand);
+                       val = (uint8_t)(rand % 122);
                        if (val < 48)
                                val += 48;
                } while((val > 57 && val < 65) || (val > 90 && val < 97));