source: increase sleep time and change readdir to readdir_r 73/62773/1
authorChulHo Song <ch81.song@samsung.com>
Fri, 18 Mar 2016 06:12:50 +0000 (15:12 +0900)
committerChulHo Song <ch81.song@samsung.com>
Fri, 18 Mar 2016 06:15:06 +0000 (15:15 +0900)
Change-Id: Icf0af207f0a013c258f923883cb28cfcaf4506fe
Signed-off-by: ChulHo Song <ch81.song@samsung.com>
src/emuld.cpp
src/net.cpp

index 6f2d0663e40cc7e44e802a084758ee021326deab..b03ba994fc05cd7cada30a5238f3dbd16f05fa75 100644 (file)
@@ -62,6 +62,7 @@ static void init_plugins(void)
 {
     DIR *dirp = NULL;
     struct dirent *dir_ent = NULL;
+    struct dirent entry;
     char plugin_path[MAX_PATH] = {0, };
     void* handle = NULL;
     bool (*plugin_init)() = NULL;
@@ -75,7 +76,7 @@ static void init_plugins(void)
         return;
     }
 
-    while ((dir_ent = readdir(dirp)))
+    while ((!readdir_r(dirp, &entry, &dir_ent)))
     {
         snprintf(plugin_path, sizeof(plugin_path), "%s/%s", EMULD_PLUGIN_DIR, dir_ent->d_name);
 
index 1c07e3ceb935d78dcce5176cf537a95a6f04f544..945c7ad90fde91604a3e0a2418971efc7a5f599f 100644 (file)
@@ -298,7 +298,7 @@ void *register_connection(void* data)
 {
     int ret;
     while ((ret = connection_create(&connection)) == CONNMAN_NOT_READY) {
-        usleep(100);
+        usleep(20000);
     }
     if (CONNECTION_ERROR_NONE == ret) {
         LOGINFO("connection_create() success!: [%p]", connection);
@@ -433,7 +433,7 @@ void set_guest_addr()
         strncpy(ifrq.ifr_name, "eth0", sizeof("eth0"));
         while (ioctl(fd, SIOCGIFADDR, &ifrq) < 0) {
             /* while to get ip address */
-            usleep(100);
+            usleep(20000);
         }
         sin = (struct sockaddr_in *)&ifrq.ifr_addr;
         LOGINFO("use dynamic IP. do not need update network information.");