#define FONT_COLOR_GRAY "\033[37m"
#define MSAPI_DBG_STRERROR(fmt) do { \
- char buf[BUF_LENGTH] = {0,}; \
- LOGE(FONT_COLOR_RED""fmt""" : STANDARD ERROR [%s]"FONT_COLOR_RESET, strerror_r(errno, buf, BUF_LENGTH)); \
+ char stderror_buffer[BUF_LENGTH] = {0,}; \
+ LOGE(FONT_COLOR_RED""fmt""" : STANDARD ERROR [%s]"FONT_COLOR_RESET, strerror_r(errno, stderror_buffer, BUF_LENGTH)); \
} while (0)
#define MSAPI_DBG_SLOG(fmt, arg...) do { \
* @brief
*/
-#define _GNU_SOURCE
-
#include <errno.h>
#include <glib.h>
#include <stdio.h>
*
*/
-#define _GNU_SOURCE
#include <unistd.h>
#include <string.h>
#include <errno.h>
*
*/
-#define _GNU_SOURCE
#include <string.h>
#include <unistd.h>
#include <errno.h>
if (handle_list_internal != NULL) {
for (i = 0; i < handle_list_internal->len; i++) {
data = g_array_index(handle_list_internal , MediaNotiHandle, i);
- MSAPI_DBG_INFO("%x %x", handle, data);
+ MSAPI_DBG_INFO("%p %p", handle, data);
if (data == handle) {
MSAPI_DBG("FIND HANDLE");
*idx = i;
#include "media-util-internal.h"
#include "media-util.h"
#include <glib.h>
+#include <unistd.h>
+#include <sys/types.h>
#ifdef _USE_SENIOR_MODE
#include <system_info.h>
%else
export CFLAGS="$CFLAGS -D_USE_MULTI_USER -D_USE_META_UPDATE -D_USE_DEVICED_DBUS"
%endif
-export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
+export CFLAGS="$CFLAGS -D_GNU_SOURCE -DTIZEN_DEBUG_ENABLE -DSYSCONFDIR=\\\"%{_sysconfdir}\\\""
export CFLAGS+=" -DPATH_LIBDIR=\\\"%{_libdir}\\\""
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
SECURE_LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \
} } while (false)
+#define MS_DBG_SERR(fmt, arg...) do { if (true) { \
+ SECURE_LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \
+ } } while (false)
+
#define MS_DBG(fmt, arg...) do { if (true) { \
LOGD(FONT_COLOR_RESET""fmt"", ##arg); \
} } while (false)
*folder_id = NULL;
}
- MS_DBG("folder_id [%s]", folder_id);
+ MS_DBG("folder_id [%s]", *folder_id);
return res;
}
* limitations under the License.
*
*/
-#define _GNU_SOURCE
+
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
*
*/
-#define _GNU_SOURCE
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
ms_user_storage_type_t storage_type = -1;
int ret = MS_MEDIA_ERR_NONE;
+ if (!MS_STRING_VALID(file_path)) {
+ MS_DBG_ERR("Invalid path");
+ return MS_MEDIA_ERR_INVALID_PARAMETER;
+ }
+
/* check location of file */
/* file must exists under "/opt/usr/media" or "/opt/storage/sdcard" */
ret = ms_user_get_storage_type(uid, file_path, &storage_type);
/* check the file exits actually */
exist = open(file_path, O_RDONLY);
if (exist < 0) {
- MS_DBG_ERR("[%s]open files");
+ MS_DBG_SERR("open file fail [%s]", file_path);
return MS_MEDIA_ERR_INVALID_PATH;
}
close(exist);
*
*/
-#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
*
*/
-#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
ret = ms_get_folder_list(handle, storage_id, start_path, dir_array);
if (ret != MS_MEDIA_ERR_NONE) {
MS_SAFE_FREE(start_path);
- MS_DBG_ERR("ms_get_folder_list is failed", ret);
+ MS_DBG_ERR("ms_get_folder_list is failed [%d]", ret);
return ret;
}
int ret;
int err;
void **handle = NULL;
- ms_user_storage_type_t storage_type = MS_STORAGE_INTERNAL;
+ ms_user_storage_type_t storage_type = MS_USER_STORAGE_INTERNAL;
int scan_type;
bool valid_status = TRUE;
char *update_path = NULL;
if (scan_type != MS_MSG_STORAGE_INVALID)
ms_bacth_commit_enable(handle, TRUE, valid_status, MS_NOTI_SWITCH_OFF, 0);
- if (scan_type == MS_MSG_STORAGE_PARTIAL && storage_type == MS_STORAGE_INTERNAL) {
+ if (scan_type == MS_MSG_STORAGE_PARTIAL && storage_type == MS_USER_STORAGE_INTERNAL) {
ms_validaty_change_all_items(handle, scan_data->storage_id, storage_type, true, uid);
/* find and compare modified time */
ret = ms_get_folder_list(handle, storage_id, start_path, dir_array);
if (ret != MS_MEDIA_ERR_NONE) {
MS_SAFE_FREE(start_path);
- MS_DBG_ERR("ms_get_folder_list is failed", ret);
+ MS_DBG_ERR("ms_get_folder_list is failed [%d]", ret);
return ret;
}
int ret;
int err;
void **handle = NULL;
- ms_user_storage_type_t storage_type = MS_STORAGE_INTERNAL;
+ ms_user_storage_type_t storage_type = MS_USER_STORAGE_INTERNAL;
int scan_type;
bool valid_status = TRUE;
char *update_path = NULL;
valid_status = (scan_type == MS_MSG_STORAGE_PARTIAL) ? TRUE : FALSE;
ms_bacth_commit_enable(handle, TRUE, valid_status, MS_NOTI_SWITCH_OFF, 0);
- if (scan_type == MS_MSG_STORAGE_PARTIAL && storage_type == MS_STORAGE_INTERNAL) {
+ if (scan_type == MS_MSG_STORAGE_PARTIAL && storage_type == MS_USER_STORAGE_INTERNAL) {
ms_validaty_change_all_items(handle, storage_id, storage_type, true, scan_data->uid);
/* find and compare modified time */
MS_DBG_ERR("msc_delete_all_record fails");
}
- if (storage_type == MS_STORAGE_EXTERNAL) {
+ if (storage_type == MS_USER_STORAGE_EXTERNAL) {
/*storage info updated in media-server*/
/*ms_update_mmc_info();*/
}
* limitations under the License.
*
*/
-#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>
* limitations under the License.
*
*/
-#define _GNU_SOURCE
+
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/stat.h>
if (err == MS_MEDIA_ERR_NONE) {
err = __ms_send_request(send_msg);
if (err != MS_MEDIA_ERR_NONE) {
- MS_DBG_ERR("__ms_send_request failed", err);
+ MS_DBG_ERR("__ms_send_request failed [%d]", err);
}
} else {
- MS_DBG_ERR("Scanner starting failed. %d", err);
+ MS_DBG_ERR("Scanner starting failed [%d]", err);
res = err;
}
}
int send_msg = MS_MEDIA_ERR_NONE;
if (error != NULL) {
- MS_DBG_SLOG("g_thread_pool_push failed [%d]", error->message);
+ MS_DBG_SLOG("g_thread_pool_push failed [%s]", error->message);
g_error_free(error);
error = NULL;
}
* limitations under the License.
*
*/
-#define _GNU_SOURCE
#include <dirent.h>
#include <errno.h>