From: Seonah Moon Date: Tue, 23 May 2017 04:19:16 +0000 (+0900) Subject: [RQ170516-00433] Fixed build warnings X-Git-Tag: accepted/tizen/unified/20170531.082459^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fac8926e6e19a74a82adc894a3d53a72728365b;p=platform%2Fframework%2Fweb%2Fdownload-provider.git [RQ170516-00433] Fixed build warnings - Modify cmake flags to avoid -Wcpp - Remove unused code and deprecated function Change-Id: I9b2c7b685ab963e321b0fcdf14cea6556edef4b0 Signed-off-by: Seonah Moon --- diff --git a/agent/CMakeLists.txt b/agent/CMakeLists.txt index a4b6b68..1915623 100755 --- a/agent/CMakeLists.txt +++ b/agent/CMakeLists.txt @@ -1,5 +1,10 @@ PROJECT(downloadagent2 C) +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + SET(VERSION "0.1.0") FIND_PROGRAM(UNAME NAMES uname) @@ -86,8 +91,9 @@ IF (SUPPORT_OMA_DRM) ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64") ENDIF (SUPPORT_OMA_DRM) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -SET(CMAKE_C_FLAGS_DEBUG "-O0 -Wall") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE") +SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE") ADD_DEFINITIONS("-D_ENABLE_DLOG") #This should be removed when release a target diff --git a/agent/download-agent-file.c b/agent/download-agent-file.c index 3b5c7f1..ea6d5cf 100755 --- a/agent/download-agent-file.c +++ b/agent/download-agent-file.c @@ -327,7 +327,7 @@ char *__get_extension_name(char *mime_type, * 3. requesting URL * 4. Otherwise, define it as "No name" */ -da_ret_t __get_candidate_file_name(char *user_file_name, char *url, +da_ret_t __get_candidate_file_name(const char *user_file_name, char *url, char *file_name_from_header, char **out_pure_file_name, char **out_extension) { @@ -370,10 +370,10 @@ da_ret_t __decide_file_path(da_info_t *da_info) char *extension = DA_NULL; char *file_name = DA_NULL; char *tmp_file_path = DA_NULL; - char *install_dir = DA_NULL; - char *user_file_name = DA_NULL; char *file_name_from_header = DA_NULL; char *url = DA_NULL; + const char *install_dir = DA_NULL; + const char *user_file_name = DA_NULL; file_info_t *file_info = DA_NULL; req_info_t *req_info = DA_NULL; http_info_t *http_info = DA_NULL; @@ -392,14 +392,13 @@ da_ret_t __decide_file_path(da_info_t *da_info) NULL_CHECK_RET(slot); if (req_info->install_path) - install_dir = req_info->install_path; - else - { + install_dir = (const char *)req_info->install_path; + else { tzplatform_set_user(slot->credential.uid); install_dir = DA_DEFAULT_INSTALL_PATH_FOR_PHONE; tzplatform_reset_user(); } - user_file_name = req_info->file_name; + user_file_name = (const char *)req_info->file_name; /* If there is location url from response header in case of redirection, * it try to parse the file name from the location url */ if (http_info->location_url) { @@ -779,10 +778,10 @@ void get_file_size(char *file_path, da_size_t *out_file_size) return; } -char *get_full_path_avoided_duplication(char *in_dir, +char *get_full_path_avoided_duplication(const char *in_dir, char *in_candidate_file_name, char *in_extension) { - char *dir = in_dir; + char *dir = NULL; char *file_name = in_candidate_file_name; char *extension = in_extension; char *final_path = DA_NULL; @@ -797,6 +796,10 @@ char *get_full_path_avoided_duplication(char *in_dir, if (!in_dir || !in_candidate_file_name) return DA_NULL; + dir = strdup(in_dir); + if (!dir) + return DA_NULL; + //DA_SECURE_LOGI("in_candidate_file_name=[%s],in_extension=[%s]", //in_candidate_file_name, in_extension); @@ -817,6 +820,7 @@ char *get_full_path_avoided_duplication(char *in_dir, final_path = (char*)calloc(1, final_path_len); if (!final_path) { DA_LOGE("DA_ERR_FAIL_TO_MEMALLOC"); + free(dir); return DA_NULL; } @@ -856,6 +860,8 @@ char *get_full_path_avoided_duplication(char *in_dir, } while (1); //DA_SECURE_LOGD("decided path = [%s]", final_path); + free(dir); + return final_path; } @@ -863,7 +869,9 @@ char *get_full_path_avoided_duplication(char *in_dir, da_ret_t check_drm_convert(file_info_t *file_info) { da_ret_t ret = DA_RESULT_OK; +#ifdef _ENABLE_OMA_DRM da_bool_t ret_b = DA_TRUE; +#endif DA_LOGD(""); @@ -916,12 +924,12 @@ void remove_file(const char *file_path) } } -da_ret_t get_available_memory(char *dir_path, da_size_t len) +da_ret_t get_available_memory(const char *dir_path, da_size_t len) { da_ret_t ret = DA_RESULT_OK; int fs_ret = 0; - //struct statfs filesys_info = {0, }; - struct statvfs filesys_info; + struct statfs filesys_info = {0, }; + //struct statvfs filesys_info; DA_LOGV(""); diff --git a/agent/download-agent-http-mgr.c b/agent/download-agent-http-mgr.c index 3e9d4d6..17d3f33 100755 --- a/agent/download-agent-http-mgr.c +++ b/agent/download-agent-http-mgr.c @@ -604,22 +604,21 @@ da_ret_t __check_enough_memory(http_info_t *http_info, req_info_t *req_info) { da_ret_t ret = DA_RESULT_OK; da_size_t cont_len = 0; - char *dir_path = DA_NULL; - char *user_install_path = DA_NULL; dp_client_slots_fmt *slot = DA_NULL; + const char *dir_path = DA_NULL; + const char *user_install_path = DA_NULL; DA_LOGV(""); NULL_CHECK_RET(http_info); cont_len = http_info->content_len_from_header; NULL_CHECK_RET(req_info); - user_install_path = req_info->install_path; + user_install_path = (const char*)req_info->install_path; slot = req_info->user_client_data; NULL_CHECK_RET(slot); if (cont_len > 0) { - if (user_install_path) + if (user_install_path) { dir_path = user_install_path; - else - { + } else { tzplatform_set_user(slot->credential.uid); dir_path = DA_DEFAULT_INSTALL_PATH_FOR_PHONE; tzplatform_reset_user(); @@ -841,7 +840,7 @@ da_ret_t __check_resume_download_is_available( char *value = NULL; da_size_t size = 0; char *temp_file_path = DA_NULL; - char *dir_path = DA_NULL; + const char *dir_path = DA_NULL; dp_client_slots_fmt *slot = DA_NULL; DA_LOGV(""); @@ -879,7 +878,7 @@ da_ret_t __check_resume_download_is_available( if (remained_content_len > 0) { if (req_info->install_path) - dir_path = req_info->install_path; + dir_path = (const char *)req_info->install_path; else { tzplatform_set_user(slot->credential.uid); diff --git a/agent/download-agent-http-msg-handler.c b/agent/download-agent-http-msg-handler.c index cc21267..a3fe0d2 100755 --- a/agent/download-agent-http-msg-handler.c +++ b/agent/download-agent-http-msg-handler.c @@ -618,7 +618,7 @@ da_bool_t __get_http_header_option_for_field( da_bool_t __get_http_header_for_field(http_msg_response_t *http_msg_response, const char *in_field, http_header_t **out_header) { - http_msg_iter_t http_msg_iter; + http_msg_iter_t http_msg_iter = DA_NULL; http_header_t *header = NULL; char *field = NULL; @@ -639,7 +639,7 @@ da_bool_t __get_http_header_for_field(http_msg_response_t *http_msg_response, da_bool_t __get_http_req_header_for_field(http_msg_request_t *http_msg_request, const char *in_field, http_header_t **out_header) { - http_msg_iter_t http_msg_iter; + http_msg_iter_t http_msg_iter = DA_NULL; http_header_t *header = NULL; char *field = NULL; diff --git a/agent/download-agent-plugin-conf.c b/agent/download-agent-plugin-conf.c index c3dadc7..9d9e1b8 100755 --- a/agent/download-agent-plugin-conf.c +++ b/agent/download-agent-plugin-conf.c @@ -41,7 +41,6 @@ da_ret_t __get_conf_string(const char *key, char **out_string) da_ret_t get_user_agent_string(char **uagent_str) { da_ret_t ret = DA_RESULT_OK; - char *key = DA_NULL; DA_LOGV(""); @@ -49,16 +48,7 @@ da_ret_t get_user_agent_string(char **uagent_str) DA_LOGE("Invalid Argument"); return DA_ERR_INVALID_ARGUMENT; } -#if 0 - key = VCONFKEY_BROWSER_USER_AGENT; - ret = __get_conf_string(key, uagent_str); - if(ret == DA_RESULT_OK) { - if(*uagent_str) { -// DA_SECURE_LOGD("getting uagent_str = \n%s", *uagent_str); - return ret; - } - } -#endif + DA_LOGI("No UA information from vconf !!"); *uagent_str = strdup(DEFAULT_UA_STR); DA_LOGV("Set default UA"); diff --git a/agent/include/download-agent-file.h b/agent/include/download-agent-file.h index 6f960ce..a70be1f 100755 --- a/agent/include/download-agent-file.h +++ b/agent/include/download-agent-file.h @@ -38,8 +38,8 @@ da_ret_t start_file_writing(da_info_t *da_info); da_ret_t start_file_append(file_info_t *file_info); da_ret_t discard_download(file_info_t *file_info) ; void clean_paused_file(file_info_t *file_info); -char *get_full_path_avoided_duplication(char *in_dir, +char *get_full_path_avoided_duplication(const char *in_dir, char *in_candidate_file_name, char *in_extension); void remove_file(const char *file_path); -da_ret_t get_available_memory(char *dir_path, da_size_t len); +da_ret_t get_available_memory(const char *dir_path, da_size_t len); #endif diff --git a/packaging/download-provider.spec b/packaging/download-provider.spec index b8e8b71..3a831c5 100755 --- a/packaging/download-provider.spec +++ b/packaging/download-provider.spec @@ -1,7 +1,7 @@ %define _ux_define tizen2.3 Name: download-provider Summary: Download the contents in background -Version: 2.1.78 +Version: 2.1.79 Release: 0 Group: Development/Libraries License: Apache-2.0 @@ -82,7 +82,7 @@ Description: Download the contents in background (development files) %define support_knox ON %define _manifest_name %{name}.manifest -%if 0%{?model_build_feature_wlan_p2p_disable } +%if 0%{?model_build_feature_wlan_p2p_disable} %define wifi_direct OFF %endif %if "%{?tizen_profile_name}" == "wearable" @@ -94,78 +94,74 @@ Description: Download the contents in background (development files) %define support_knox ON %endif -%define cmake \ - CFLAGS="${CFLAGS:-%optflags} -fPIC -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fvisibility=hidden"; export CFLAGS \ - FFLAGS="${FFLAGS:-%optflags} -fPIC -fvisibility=hidden"; export FFLAGS \ - LDFLAGS+=" -Wl,--as-needed -Wl,--hash-style=both"; export LDFLAGS \ - %__cmake \\\ - -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ - -DBIN_INSTALL_DIR:PATH=%{_bindir} \\\ - -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ - %ifarch aarch64 x86_64 \ - -DLIB_AGENT_PATH="/usr/lib64/libdownloadagent2.so" \\\ - %else \ - -DLIB_AGENT_PATH="/usr/lib/libdownloadagent2.so" \\\ - %endif \ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ - -DPKG_NAME=%{name} \\\ - -DPKG_VERSION=%{version} \\\ - -DPKG_RELEASE=%{release} \\\ - -DIPC_SOCKET:PATH=%{_ipc_socket} \\\ - -DPROVIDER_DIR:PATH=%{_data_install_path} \\\ - -DNOTIFY_DIR:PATH=%{_notifydir} \\\ - -DDATABASE_DIR:PATH=%{_databasedir} \\\ - -DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \\\ - -DIMAGE_DIR:PATH=%{_imagedir} \\\ - -DLOCALE_DIR:PATH=%{_localedir} \\\ - -DSUPPORT_WIFI_DIRECT:BOOL=OFF \\\ - %if "%{?download_booster}" == "ON" \ - -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=ON \\\ - %else \ - -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \\\ - %endif \ - %if "%{?support_notification}" == "ON" \ - -DSUPPORT_NOTIFICATION:BOOL=ON \\\ - %else \ - -DSUPPORT_NOTIFICATION:BOOL=OFF \\\ - %endif \ - -DSUPPORT_LOG_MESSAGE:BOOL=ON \\\ - %if "%{?support_oma_drm}" == "ON" \ - -DSUPPORT_OMA_DRM:BOOL=ON \\\ - %else \ - -DSUPPORT_OMA_DRM:BOOL=OFF \\\ - %endif \ - %if "%{?support_security_privilege}" == "ON" \ - -DSUPPORT_SECURITY_PRIVILEGE:BOOL=ON \\\ - %else \ - -DSUPPORT_SECURITY_PRIVILEGE:BOOL=OFF \\\ - %endif \ - %if "%{?support_companion_mode}" == "ON" \ - -DSUPPORT_COMPANION_MODE:BOOL=ON \\\ - %else \ - -DSUPPORT_COMPANION_MODE:BOOL=OFF \\\ - %endif \ - %if "%{?support_knox}" == "ON" \ - -DSUPPORT_KNOX:BOOL=ON \\\ - %else \ - -DSUPPORT_KNOX:BOOL=OFF \\\ - %endif \ - %if "%{?_ux_define}" == "tizen2.3" \ - -DTIZEN_2_3_UX:BOOL=ON \\\ - %endif \ - -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \\\ - -DHTTP_LIB=%{_http_lib} \\\ - %if "%{?_lib}" == "lib64" \ - %{?_cmake_lib_suffix64} \\\ - %endif \ - %{?_cmake_skip_rpath} \\\ - -DBUILD_SHARED_LIBS:BOOL=ON - %build export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE" export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE" export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" -%cmake . -DTZ_SYS_GLOBALUSER_DATA=%TZ_SYS_GLOBALUSER_DATA + +%cmake -DTZ_SYS_GLOBALUSER_DATA=%TZ_SYS_GLOBALUSER_DATA \ + -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \ + -DBIN_INSTALL_DIR:PATH=%{_bindir} \ + -DLIB_INSTALL_DIR:PATH=%{_libdir} \ +%ifarch aarch64 x86_64 + -DLIB_AGENT_PATH="/usr/lib64/libdownloadagent2.so" \ +%else + -DLIB_AGENT_PATH="/usr/lib/libdownloadagent2.so" \ +%endif + -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \ + -DPKG_NAME=%{name} \ + -DPKG_VERSION=%{version} \ + -DPKG_RELEASE=%{release} \ + -DIPC_SOCKET:PATH=%{_ipc_socket} \ + -DPROVIDER_DIR:PATH=%{_data_install_path} \ + -DNOTIFY_DIR:PATH=%{_notifydir} \ + -DDATABASE_DIR:PATH=%{_databasedir} \ + -DDATABASE_CLIENT_DIR:PATH=%{_database_client_dir} \ + -DIMAGE_DIR:PATH=%{_imagedir} \ + -DLOCALE_DIR:PATH=%{_localedir} \ + -DSUPPORT_WIFI_DIRECT:BOOL=OFF \ +%if "%{?download_booster}" == "ON" + -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=ON \ +%else \ + -DSUPPORT_DOWNLOAD_BOOSTER:BOOL=OFF \ +%endif +%if "%{?support_notification}" == "ON" + -DSUPPORT_NOTIFICATION:BOOL=ON \ +%else + -DSUPPORT_NOTIFICATION:BOOL=OFF \ +%endif + -DSUPPORT_LOG_MESSAGE:BOOL=ON \ +%if "%{?support_oma_drm}" == "ON" + -DSUPPORT_OMA_DRM:BOOL=ON \ +%else + -DSUPPORT_OMA_DRM:BOOL=OFF \ +%endif +%if "%{?support_security_privilege}" == "ON" + -DSUPPORT_SECURITY_PRIVILEGE:BOOL=ON \ +%else \ + -DSUPPORT_SECURITY_PRIVILEGE:BOOL=OFF \ +%endif +%if "%{?support_companion_mode}" == "ON" + -DSUPPORT_COMPANION_MODE:BOOL=ON \ +%else + -DSUPPORT_COMPANION_MODE:BOOL=OFF \ +%endif +%if "%{?support_knox}" == "ON" + -DSUPPORT_KNOX:BOOL=ON \ +%else + -DSUPPORT_KNOX:BOOL=OFF \ +%endif +%if "%{?_ux_define}" == "tizen2.3" + -DTIZEN_2_3_UX:BOOL=ON \ +%endif + -DCMAKE_LOG_DUMP_SCRIPT_DIR=%{_logdump_script_dir} \ + -DHTTP_LIB=%{_http_lib} \ +%if "%{?_lib}" == "lib64" + %{?_cmake_lib_suffix64} \ +%endif + %{?_cmake_skip_rpath} \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + . make %{?jobs:-j%jobs} @@ -177,10 +173,9 @@ mkdir -p %{buildroot}/etc/notstrip/ install -m 644 packaging/download-provider.notstrip %{buildroot}/etc/notstrip/download-provider.notstrip %endif -#%if 0%{?sec_product_feature_container_enable} +## container_enable mkdir -p %{buildroot}/etc/vasum/vsmzone.resource/ mv %{buildroot}/usr/share/download-provider/download-provider.res %{buildroot}/etc/vasum/vsmzone.resource/ -#%endif mkdir -p %{buildroot}/lib/systemd/system/graphical.target.wants mkdir -p %{buildroot}/lib/systemd/system/sockets.target.wants @@ -221,9 +216,8 @@ chown -R web_fw:web_fw %{_data_install_path} %{_libdir}/libdownload-provider-interface.so.0 %{_bindir}/%{name} %attr(0544,root,root) %{_logdump_script_dir}/dump-%{name}.sh -#%if 0%{?sec_product_feature_container_enable} +## container_enable %attr(0644,root,root) /etc/vasum/vsmzone.resource/download-provider.res -#%endif %{upgrade_script_path}/500.download-provider_upgrade.sh %if ("%{VD_PRODUCT_TYPE}" == "AUDIO") || ("%{VD_PRODUCT_TYPE}" == "TV") || ("%{VD_PRODUCT_TYPE}" == "LFD") || ("%{VD_PRODUCT_TYPE}" == "HTV") || ("%{VD_PRODUCT_TYPE}" == "AV") /etc/notstrip/download-provider.notstrip diff --git a/provider-interface/CMakeLists.txt b/provider-interface/CMakeLists.txt index 0b44f58..a20b7dd 100755 --- a/provider-interface/CMakeLists.txt +++ b/provider-interface/CMakeLists.txt @@ -4,7 +4,7 @@ PROJECT(download-provider-interface C) SET(PACKAGE_DESCRIPTION "Interface supported by download-provider") IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Debug") + SET(CMAKE_BUILD_TYPE "Release") ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") @@ -29,8 +29,9 @@ SET(PROVIDER_INTERFACE_LINK_LIBRARIES pthread ) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -fPIE") +SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE") ADD_DEFINITIONS(-DDOWNLOAD_PROVIDER_LOG_TAG=\"DOWNLOAD_PROVIDER_INTERFACE\") diff --git a/provider/CMakeLists.txt b/provider/CMakeLists.txt index cea9646..6daa676 100755 --- a/provider/CMakeLists.txt +++ b/provider/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(${PKG_NAME} C) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") - SET(CMAKE_BUILD_TYPE "Debug") + SET(CMAKE_BUILD_TYPE "Release") ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") @@ -82,8 +82,9 @@ set(DP2_LINK_LIBRARIES ${GLIB-2_LIBRARIES} capi-appfw-app-manager ) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") -SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -Wall -fPIE") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden") +SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -fPIE") +SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE") IF(DEFINED IMAGE_DIR) ADD_DEFINITIONS(-DIMAGE_DIR=\"${IMAGE_DIR}\") diff --git a/provider/download-provider-db.c b/provider/download-provider-db.c index 0e81fc4..8e1d06d 100755 --- a/provider/download-provider-db.c +++ b/provider/download-provider-db.c @@ -1318,9 +1318,8 @@ int dp_db_get_http_headers_list(void *handle, int id, char **headers, int *error int len = snprintf(headers_buffer, buffer_length + 1, "%s:%s", header_field, header_data); if (len <= 0) { - if (headers_buffer) - free(headers_buffer); - continue; + free(headers_buffer); + continue; } else { headers_buffer[len] = '\0'; } diff --git a/provider/download-provider-main.c b/provider/download-provider-main.c index 10a13cc..542e9d4 100755 --- a/provider/download-provider-main.c +++ b/provider/download-provider-main.c @@ -36,8 +36,6 @@ int main(int argc, char **argv) GMainLoop *event_loop; TRACE_INFO("download-provider's working is started"); - g_type_init(); - event_loop = g_main_loop_new(NULL, FALSE); if (!event_loop) { TRACE_ERROR("Failed to create g main loop handle"); diff --git a/provider/download-provider-plugin-download-agent.c b/provider/download-provider-plugin-download-agent.c index f9e1b80..4286d0e 100755 --- a/provider/download-provider-plugin-download-agent.c +++ b/provider/download-provider-plugin-download-agent.c @@ -206,8 +206,6 @@ static int __set_file_permission_to_client(dp_client_slots_fmt *slot, dp_request struct stat fstat_info; int fd; int errorcode = DP_ERROR_NONE; - char *str = NULL; - str = strrchr(saved_path, '/'); dp_credential cred = slot->credential; if (lstat(saved_path, &lstat_info) != -1) { fd = open (saved_path, O_RDONLY); diff --git a/provider/download-provider-queue-manager.c b/provider/download-provider-queue-manager.c index e01b7ea..317f84a 100644 --- a/provider/download-provider-queue-manager.c +++ b/provider/download-provider-queue-manager.c @@ -17,6 +17,7 @@ #include #include // pthread_kill #include // ESRCH +#include #include #include