diff options
author | Sunmin Lee <sunm.lee@samsung.com> | 2017-01-18 14:23:37 +0900 |
---|---|---|
committer | Sunmin Lee <sunm.lee@samsung.com> | 2017-01-18 15:24:49 +0900 |
commit | 4b7c85115819ea91a3415114b12b3ed009419878 (patch) | |
tree | e2f1149892dae3e9347fa6c8d347178b90fb0a9c | |
parent | 7de8af5d021577a3c00d45e8f153ef216e89f1e3 (diff) | |
download | crash-worker-accepted/tizen/unified/20170309.033723.tar.gz crash-worker-accepted/tizen/unified/20170309.033723.tar.bz2 crash-worker-accepted/tizen/unified/20170309.033723.zip |
(Modified) Deal with Toolchain upgradesubmit/tizen_unified/20170308.100409submit/tizen/20170118.071648accepted/tizen/wearable/20170118.223022accepted/tizen/unified/20170309.033723accepted/tizen/tv/20170118.223006accepted/tizen/mobile/20170118.222949accepted/tizen/ivi/20170118.223040accepted/tizen/common/20170118.174031accepted/tizen_wearableaccepted/tizen_tvaccepted/tizen_mobileaccepted/tizen_iviaccepted/tizen_common
(Revert "Deal with Toolchain upgrade")
This patch substitutes deprecated function "readdir_r" with "readdir"
rather than ignoring warning.
Change-Id: I3b4d3f9c28cc60c851f30332aa88780078471085
Signed-off-by: Sunmin Lee <sunm.lee@samsung.com>
-rw-r--r-- | src/crash-manager/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/crash-stack/crash-stack.c | 3 | ||||
-rwxr-xr-x | src/dump_systemstate/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/log_dump/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/shared/util.c | 18 | ||||
-rw-r--r-- | src/sys-assert/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/sys-assert/sys-assert.c | 3 |
7 files changed, 10 insertions, 24 deletions
diff --git a/src/crash-manager/CMakeLists.txt b/src/crash-manager/CMakeLists.txt index 9ac26d1..357fcaa 100644 --- a/src/crash-manager/CMakeLists.txt +++ b/src/crash-manager/CMakeLists.txt @@ -23,7 +23,7 @@ FOREACH(flag ${crash-manager_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE -Wno-deprecated-declarations") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") CONFIGURE_FILE(crash-manager.h.in crash-manager.h @ONLY) ADD_EXECUTABLE(${PROJECT_NAME} ${CRASH_MANAGER_SRCS}) diff --git a/src/crash-stack/crash-stack.c b/src/crash-stack/crash-stack.c index 7471e86..b64df73 100644 --- a/src/crash-stack/crash-stack.c +++ b/src/crash-stack/crash-stack.c @@ -687,7 +687,6 @@ static void __crash_stack_print_threads(FILE* outputfile, pid_t pid, pid_t tid) { int threadnum=1; DIR *dir; - struct dirent entry; struct dirent *dentry=NULL; char task_path[PATH_MAX]; struct stat sb; @@ -710,7 +709,7 @@ static void __crash_stack_print_threads(FILE* outputfile, pid_t pid, pid_t tid) if (!dir) { fprintf(errfile, "[crash-stack] cannot open %s\n", task_path); } else { - while (readdir_r(dir, &entry, &dentry) == 0 && dentry) { + while ((dentry = readdir(dir))) { if (strcmp(dentry->d_name, ".") == 0 || strcmp(dentry->d_name, "..") == 0) continue; diff --git a/src/dump_systemstate/CMakeLists.txt b/src/dump_systemstate/CMakeLists.txt index d889526..d15805b 100755 --- a/src/dump_systemstate/CMakeLists.txt +++ b/src/dump_systemstate/CMakeLists.txt @@ -16,7 +16,7 @@ ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer -finstrument-functions") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE -Wno-deprecated-declarations") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") MESSAGE("FLAGS: ${CMAKE_C_FLAGS}") ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) diff --git a/src/log_dump/CMakeLists.txt b/src/log_dump/CMakeLists.txt index 8504860..20202b6 100644 --- a/src/log_dump/CMakeLists.txt +++ b/src/log_dump/CMakeLists.txt @@ -20,7 +20,7 @@ FOREACH(flag ${log_dump_pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE -Wno-deprecated-declarations") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") CONFIGURE_FILE(log_dump.h.in log_dump.h @ONLY) ADD_EXECUTABLE(${PROJECT_NAME} ${LOG_DUMP_SRCS}) diff --git a/src/shared/util.c b/src/shared/util.c index 01445fd..b124572 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -292,7 +292,6 @@ int run_command_write_fd(char *cmd, int dfd) static int remove_dir_internal(int fd) { DIR *dir; - struct dirent e; struct dirent *de; int subfd, ret = 0; @@ -300,7 +299,7 @@ static int remove_dir_internal(int fd) if (!dir) return -1; - while ((ret = readdir_r(dir, &e, &de)) == 0 && de) { + while ((de = readdir(dir))) { if (de->d_type == DT_DIR) { if (!strncmp(de->d_name, ".", 2) || !strncmp(de->d_name, "..", 3)) continue; @@ -354,7 +353,6 @@ int remove_dir(const char *path, int del_dir) int get_exec_pid(const char *execpath) { DIR *dp; - struct dirent entry; struct dirent *dentry; int pid = -1, fd; int ret; @@ -369,10 +367,8 @@ int get_exec_pid(const char *execpath) } len = strlen(execpath) + 1; - if ((readdir_r(dp, &entry, &dentry)) != 0) - dentry = NULL; - while (dentry != NULL) { + while ((dentry = readdir(dp))) { if (!isdigit(dentry->d_name[0])) continue; @@ -404,7 +400,6 @@ int get_exec_pid(const char *execpath) int get_file_count(char *path) { DIR *dir; - struct dirent p; struct dirent *dp; int count = 0; @@ -412,10 +407,7 @@ int get_file_count(char *path) if (!dir) return 0; - if ((readdir_r(dir, &p, &dp)) != 0) - dp = NULL; - - while (dp != NULL) { + while ((dp = readdir(dir))) { const char *name = dp->d_name; /* always skip "." and ".." */ if (name[0] == '.') { @@ -433,12 +425,10 @@ int get_file_count(char *path) int get_directory_usage(char *path) { DIR *dir; - struct dirent e; struct dirent *de; struct stat st; size_t usage = 0; int fd = -1; - int ret; fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME); if (fd < 0) @@ -449,7 +439,7 @@ int get_directory_usage(char *path) return -1; } - while ((ret = readdir_r(dir, &e, &de)) == 0 && de) { + while ((de = readdir(dir))) { if (!strncmp(de->d_name, ".", 2) || !strncmp(de->d_name, "..", 3)) continue; if (fstatat(fd, de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { diff --git a/src/sys-assert/CMakeLists.txt b/src/sys-assert/CMakeLists.txt index 11672d0..e6c7ca0 100644 --- a/src/sys-assert/CMakeLists.txt +++ b/src/sys-assert/CMakeLists.txt @@ -48,8 +48,6 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") SET(CMAKE_C_FLAGS_RELEASE "-O2") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations") - FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") IF("${ARCH}" STREQUAL "arm") @@ -71,4 +69,4 @@ INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-debug-on.service DESTINATION /us INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/tizen-debug-off.service DESTINATION /usr/lib/systemd/system PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
\ No newline at end of file diff --git a/src/sys-assert/sys-assert.c b/src/sys-assert/sys-assert.c index 0c1bbf2..212e966 100644 --- a/src/sys-assert/sys-assert.c +++ b/src/sys-assert/sys-assert.c @@ -595,7 +595,6 @@ void sighandler(int signum, siginfo_t *info, void *context) pid_t pid; pid_t tid; DIR *dir; - struct dirent entry; struct dirent *dentry=NULL; char timestr[TIME_MAX_LEN]; char processname[NAME_MAX] = {0,}; @@ -773,7 +772,7 @@ void sighandler(int signum, siginfo_t *info, void *context) if (!dir) { fprintf(stderr, "[sys-assert]can't open %s\n", TASK_PATH); } else { - while (readdir_r(dir, &entry, &dentry) == 0 && dentry) { + while ((dentry = readdir(dir))) { if (strcmp(dentry->d_name, ".") == 0 || strcmp(dentry->d_name, "..") == 0) continue; |