#ifndef _MEDIA_SERVER_IPC_H_
#define _MEDIA_SERVER_IPC_H_
-#define MS_TIMEOUT_SEC_10 10 /**< Response from Server time out */
-#define MS_TIMEOUT_SEC_20 20 /**< Response from Media server time out */
+#define MS_TIMEOUT_SEC 10
typedef enum {
MS_SCAN_DAEMON_PORT = 0, /**< Port of communication between scanner and server */
#endif
#include <stdbool.h>
-#include <sys/types.h>
#include <sqlite3.h>
int media_db_connect(sqlite3 **handle, uid_t uid, bool need_write);
-
void media_db_disconnect(sqlite3 *handle);
-
int media_db_request_update_db(const char *query_str, uid_t uid);
-
int media_db_update_db_direct(const char *query_str, uid_t uid);
-
int media_db_check_integrity(sqlite3 *handle);
-
int media_db_get_result(sqlite3 *handle, char *sql_str, sqlite3_stmt **stmt);
/**
#ifndef _MEDIA_UTIL_INTERNAL_H_
#define _MEDIA_UTIL_INTERNAL_H_
-#include <stdint.h>
+#include <glib.h>
#include <sqlite3.h>
-#include "media-util-db.h"
-
#define MS_SAFE_FREE(src) { if (src) {free(src); src = NULL; } }
#define MS_SQL_SAFE_FREE(x) {if (x != NULL) {sqlite3_free(x); x = NULL; } }
#define MS_STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? true : false)
#include <glib.h>
#include <stdbool.h>
-#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
extern "C" {
#endif
-#include <sys/types.h>
-
typedef enum {
MS_USER_STORAGE_INTERNAL = 0, /**< The device's internal storage */
MS_USER_STORAGE_EXTERNAL = 1, /**< The device's external storage */
*/
#include <unistd.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-
#include <dlfcn.h>
#include <unicode/utypes.h>
send_msg.uid = uid;
/*Create Socket*/
- ret = ms_ipc_create_client_socket(MS_TIMEOUT_SEC_10, &sockfd);
+ ret = ms_ipc_create_client_socket(MS_TIMEOUT_SEC, &sockfd);
MSAPI_RETV_IF(ret != MS_MEDIA_ERR_NONE, ret);
/*Set server Address*/
send_msg.uid = uid;
/*Create Socket*/
- ret = ms_ipc_create_client_socket(MS_TIMEOUT_SEC_10, &sockfd);
+ ret = ms_ipc_create_client_socket(MS_TIMEOUT_SEC, &sockfd);
MSAPI_RETV_IF(ret != MS_MEDIA_ERR_NONE, ret);
/*Set server Address*/
#include "media-util.h"
#include <glib.h>
#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#define USER_BAND 5000;
#ifndef _MEDIA_SERVER_SOCKET_H_
#define _MEDIA_SERVER_SOCKET_H_
-#include <sys/stat.h>
#include "media-common-types.h"
#include "media-server-ipc.h"
}
/*prepare socket*/
- g_mkdir_with_parents(tzplatform_mkpath(TZ_SYS_RUN, "media-server"), S_IRWXU | S_IRWXG | S_IRWXO);
+ g_mkdir_with_parents(tzplatform_mkpath(TZ_SYS_RUN, "media-server"), 0777);
if (ms_ipc_create_server_socket(MS_SCANNER_PORT, &sockfd) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to create socket");
*
*/
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <malloc.h>