/*
- * Copyright (c) 2014 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014-2020 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.
#include <descriptor-set.h>
#include <dpl/errno_string.h>
+#include <utils.h>
using namespace CKM;
const int POLL_TIMEOUT = 8000;
const int POLL_TIMEOUT_SHORT = 1000;
-typedef std::unique_ptr<int[], std::function<void(int *)>> PipePtr;
-
const short POLLALL = std::numeric_limits<short>::max();
void closePipe(int *fd)
#define PIPE(fd) \
int (fd)[2]; \
BOOST_REQUIRE_MESSAGE(0 == pipe((fd)), "Pipe creation failed: " << GetErrnoString()); \
- PipePtr fd##Ptr((fd), closePipe);
+ auto fd##Ptr = uptr<closePipe>((fd));
void unexpectedCallback(int, short)
{
readFd(desc, fd[0], revents);
descriptors.remove(desc);
- descriptors.add(fd2[1], POLLOUT, [&](int desc, short revents) {
+ descriptors.add(fd2[1], POLLOUT, [&](int desc2, short revents2) {
callback2 = true;
- writeFd(desc, fd2[1], revents);
- descriptors.remove(desc);
+ writeFd(desc2, fd2[1], revents2);
+ descriptors.remove(desc2);
});
});