From d275ba74236d1122da126f0000bd04ccb63a2d55 Mon Sep 17 00:00:00 2001 From: Jiyong Min Date: Tue, 29 Aug 2017 12:34:12 +0900 Subject: Modify to do chmod() before listening server socket & remove unused user-service file (Rarely application can not access socket because of no permission) Change-Id: I0e8fb10f5dfd0c1b68e723db9a5a6c3ff4d884de Signed-off-by: Jiyong Min --- packaging/capi-media-controller.spec | 3 +-- packaging/media-controller-user.service | 12 ------------ svc/media_controller_socket.c | 8 ++++---- 3 files changed, 5 insertions(+), 18 deletions(-) delete mode 100755 packaging/media-controller-user.service diff --git a/packaging/capi-media-controller.spec b/packaging/capi-media-controller.spec index 9e2f590..912c4c2 100755 --- a/packaging/capi-media-controller.spec +++ b/packaging/capi-media-controller.spec @@ -1,13 +1,12 @@ Name: capi-media-controller Summary: A media controller library in Tizen Native API -Version: 0.1.45 +Version: 0.1.46 Release: 1 Group: Multimedia/API License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1: mediacontroller.service Source2: mediacontroller.socket -Source3: media-controller-user.service Source5: 500.media-controller.upgrade.sh BuildRequires: cmake BuildRequires: pkgconfig(capi-base-common) diff --git a/packaging/media-controller-user.service b/packaging/media-controller-user.service deleted file mode 100755 index a7b5e1a..0000000 --- a/packaging/media-controller-user.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Media controller user - -[Service] -Type=idle -CPUAccounting=true -CPUQuota=5% -ExecStartPre=/usr/bin/sleep 5 -ExecStart=/usr/bin/sh -c "/usr/bin/media-controller_create_db.sh" - -[Install] -WantedBy=default.target diff --git a/svc/media_controller_socket.c b/svc/media_controller_socket.c index 155f493..75152b6 100755 --- a/svc/media_controller_socket.c +++ b/svc/media_controller_socket.c @@ -83,6 +83,10 @@ int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd) return MEDIA_CONTROLLER_ERROR_INVALID_OPERATION; } + /*change permission of sock file*/ + if (chmod(MC_IPC_PATH, 0666) < 0) + mc_stderror("chmod failed"); + mc_debug("bind success"); /* Listening */ @@ -94,10 +98,6 @@ int mc_ipc_create_server_socket(mc_msg_port_type_e port, int *sock_fd) mc_debug("Listening..."); - /*change permission of sock file*/ - if (chmod(MC_IPC_PATH, 0666) < 0) - mc_stderror("chmod failed"); - *sock_fd = sock; return MEDIA_CONTROLLER_ERROR_NONE; -- cgit v1.2.3