Remove unused code 88/273088/1
authorTomasz Swierczek <t.swierczek@samsung.com>
Wed, 30 Mar 2022 11:10:38 +0000 (13:10 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Wed, 30 Mar 2022 11:12:15 +0000 (13:12 +0200)
Change-Id: I7ae95050e5018d3a38ee79401553b46e3dfc849b

src/common/connection.cpp
src/common/include/connection.h

index fa050aa78e1039756a7f7b3e12d18087602fa9fe..d0b05184e80c38b8d5d094564473ba5a50be8452 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2014-2022 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * This file is licensed under the terms of MIT License or the Apache License
  * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
@@ -224,49 +224,4 @@ int sendToServer(char const * const interface, const RawBuffer &send, MessageBuf
     return SECURITY_MANAGER_SUCCESS;
 }
 
-int sendToServerAncData(char const * const interface, const RawBuffer &send, struct msghdr &hdr) {
-    int ret;
-    SockRAII sock;
-    ssize_t done = 0;
-
-    if (SECURITY_MANAGER_SUCCESS != (ret = sock.Connect(interface))) {
-        LogError("Error in SockRAII");
-        return ret;
-    }
-
-    while ((send.size() - done) > 0) {
-        if (0 >= waitForSocket(sock.Get(), POLLOUT, POLL_TIMEOUT)) {
-            LogError("Error in poll(POLLOUT)");
-            return SECURITY_MANAGER_ERROR_SOCKET;
-        }
-        ssize_t temp = TEMP_FAILURE_RETRY(write(sock.Get(), &send[done], send.size() - done));
-        if (-1 == temp) {
-            int err = errno;
-            LogError("Error in write: " << GetErrnoString(err));
-            return SECURITY_MANAGER_ERROR_SOCKET;
-        }
-        done += temp;
-    }
-
-    if (0 >= waitForSocket(sock.Get(), POLLIN, POLL_TIMEOUT)) {
-        LogError("Error in poll(POLLIN)");
-        return SECURITY_MANAGER_ERROR_SOCKET;
-    }
-
-    ssize_t temp = TEMP_FAILURE_RETRY(recvmsg(sock.Get(), &hdr, MSG_CMSG_CLOEXEC));
-
-    if (temp < 0) {
-        int err = errno;
-        LogError("Error in recvmsg(): " << GetErrnoString(err) << " errno: " << err);
-        return SECURITY_MANAGER_ERROR_SOCKET;
-    }
-
-    if (0 == temp) {
-        LogError("Read return 0/Connection closed by server(?)");
-        return SECURITY_MANAGER_ERROR_SOCKET;
-    }
-
-    return SECURITY_MANAGER_SUCCESS;
-}
-
 } // namespace SecurityManager
index c8176ce2c8705e75a8c00e6b608a3ec433a69e56..c3562d9d166b38f59153268a698c7167e04cf6ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2014-2022 Samsung Electronics Co., Ltd. All rights reserved.
  *
  * This file is licensed under the terms of MIT License or the Apache License
  * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
@@ -45,14 +45,4 @@ typedef std::vector<unsigned char> RawBuffer;
 
 int sendToServer(char const * const interface, const RawBuffer &send, MessageBuffer &recv);
 
-/*
- * sendToServerAncData is special case when we want to receive file descriptor
- * passed by Security Manager on behalf of calling process. We can't get it with
- * MessageBuffer.
- *
- * This function should be called _ONLY_ in this particular case.
- *
- */
-int sendToManagerAncData(char const * const interface, const RawBuffer &send, struct msghdr &hdr);
-
 } // namespace SecurityManager