Remove unused code 46/273946/2
authorYoungjae Cho <y0.cho@samsung.com>
Tue, 19 Apr 2022 01:07:14 +0000 (18:07 -0700)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Thu, 21 Apr 2022 00:28:15 +0000 (00:28 +0000)
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 <y0.cho@samsung.com>
src/core/dbus_main.c [deleted file]
src/core/dbus_main.h [deleted file]

diff --git a/src/core/dbus_main.c b/src/core/dbus_main.c
deleted file mode 100644 (file)
index 02695cb..0000000
+++ /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 <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <dbus/dbus.h>
-#include <stdbool.h>
-#include <limits.h>
-#include <libsyscommon/libgdbus.h>
-#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 (file)
index 8efa069..0000000
+++ /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 <libsyscommon/libgdbus.h>
-
-int set_dbus_connection(const char *bus);
-
-#endif /* __STORAGED_BUS_MAIN_H__ */