From: Youngjae Cho Date: Tue, 19 Apr 2022 01:07:14 +0000 (-0700) Subject: Remove unused code X-Git-Tag: submit/tizen/20220428.054629~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d07619df3f556ef6acb5eb50fd502211850f86;p=platform%2Fcore%2Fsystem%2Fstoraged.git Remove unused code The dbus library has been replaced to gdbus of libsyscommon on the below patch. - commit b69e936ca63fce2ff6ad779b319176f622f3bd41 Therefore, remove unused dbus source code. Change-Id: I63f6d826a44e256d95846faf63346035073479d4 Signed-off-by: Youngjae Cho --- diff --git a/src/core/dbus_main.c b/src/core/dbus_main.c deleted file mode 100644 index 02695cb..0000000 --- a/src/core/dbus_main.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * storaged - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"), - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include "fd_handler.h" -#include "log.h" - -/* -1 is a default timeout value, it's converted to 25*1000 internally. */ -#define DBUS_REPLY_TIMEOUT (-1) - -int set_dbus_connection(const char *bus) -{ - static DBusConnection *conn; - static int already; - DBusError err; - int ret; - - if (conn && already) - return 0; - - dbus_error_init(&err); - - conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); - if (!conn) { - if (dbus_error_is_set(&err)) { - _E("dbus_bus_get error(%s, %s)", err.name, err.message); - dbus_error_free(&err); - } else - _E("dbus_bus_get error"); - return -ECOMM; - } - - if (!already) { - already = 1; - dbus_error_init(&err); - - ret = dbus_bus_request_name(conn, bus, - DBUS_NAME_FLAG_REPLACE_EXISTING | DBUS_NAME_FLAG_DO_NOT_QUEUE, - &err); - if (ret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { - if (dbus_error_is_set(&err)) { - _E("Failed to request dbus name(%s err.name=%s err.message=%s).", bus, err.name, err.message); - dbus_error_free(&err); - } else - _E("Failed to request dbus name(%s).", bus); - return -ECOMM; - } - } - - return 0; -} diff --git a/src/core/dbus_main.h b/src/core/dbus_main.h deleted file mode 100644 index 8efa069..0000000 --- a/src/core/dbus_main.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * storaged - * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -#ifndef __STORAGED_DBUS_MAIN_H__ -#define __STORAGED_DBUS_MAIN_H__ - -#include - -int set_dbus_connection(const char *bus); - -#endif /* __STORAGED_BUS_MAIN_H__ */