summaryrefslogtreecommitdiff
path: root/test/ipc/unixsocket.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/ipc/unixsocket.cpp')
-rw-r--r--test/ipc/unixsocket.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/ipc/unixsocket.cpp b/test/ipc/unixsocket.cpp
index b3568c06..7e90e629 100644
--- a/test/ipc/unixsocket.cpp
+++ b/test/ipc/unixsocket.cpp
@@ -52,9 +52,9 @@ public:
ipc_.readyRead.connect(this, &UnixSocketTestSlave::readyRead);
}
- int run(int fd)
+ int run(UniqueFD fd)
{
- if (ipc_.bind(fd)) {
+ if (ipc_.bind(std::move(fd))) {
cerr << "Failed to connect to IPC channel" << endl;
return EXIT_FAILURE;
}
@@ -359,11 +359,11 @@ protected:
int run()
{
- int slavefd = ipc_.create();
- if (slavefd < 0)
+ UniqueFD slavefd = ipc_.create();
+ if (!slavefd.isValid())
return TestFail;
- if (slaveStart(slavefd)) {
+ if (slaveStart(slavefd.release())) {
cerr << "Failed to start slave" << endl;
return TestFail;
}
@@ -495,9 +495,9 @@ private:
int main(int argc, char **argv)
{
if (argc == 2) {
- int ipcfd = std::stoi(argv[1]);
+ UniqueFD ipcfd = UniqueFD(std::stoi(argv[1]));
UnixSocketTestSlave slave;
- return slave.run(ipcfd);
+ return slave.run(std::move(ipcfd));
}
UnixSocketTest test;