Fix the bug of debugging information from fd directory 69/218769/3 accepted/tizen/unified/20191128.161826 submit/tizen/20191128.060302
authorYoungHun Kim <yh8004.kim@samsung.com>
Thu, 28 Nov 2019 04:41:12 +0000 (13:41 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Thu, 28 Nov 2019 05:10:23 +0000 (14:10 +0900)
Change-Id: I087db4ba66f13c7b7736ec359810d973c40535f8

core/src/muse_core.c

index 467e91b..09a8a7f 100644 (file)
@@ -752,10 +752,20 @@ void muse_core_log_process_thread_info(int pid)
 
 void muse_core_log_process_opened_fds(int pid)
 {
-       char cmd[MUSE_MSG_LEN_MAX];
+       char dir_path[MUSE_MSG_LEN_MAX];
+       struct dirent *de = NULL;
+       DIR *dr = NULL;
 
-       snprintf(cmd, sizeof(cmd), "/bin/ls -alt /proc/%d/fd", pid);
-       muse_core_log_cmd_info(cmd);
+       snprintf(dir_path, sizeof(dir_path), "/proc/%d/fd", pid); /* /proc/%d/fd is directory */
+       dr = opendir(dir_path);
+       muse_return_if_fail(dr)
+
+       LOGI("directory path : %s", dir_path);
+
+       while ((de = readdir(dr)) != NULL)
+               LOGW("%s\n", de->d_name);
+
+       closedir(dr);
 }
 
 void muse_core_log_process_cpu_memory(int pid)