Skip to content

Commit 2accf61

Browse files
committed
Adding undefined procedure.
1 parent d2c15a0 commit 2accf61

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/opt/util/util.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,22 @@ void kill_on_parent_death(int sig)
7272
#include <thread>
7373

7474
#include <cassert>
75+
#include <cerrno>
7576

7677
#include <sys/types.h>
7778
#include <sys/event.h>
7879
#include <sys/time.h>
7980

81+
template <typename Func>
82+
static auto retry_eintr(Func &&fn) -> decltype(fn())
83+
{
84+
decltype(fn()) rc;
85+
do {
86+
rc = fn();
87+
} while (rc == -1 && errno == EINTR);
88+
return rc;
89+
}
90+
8091
void kill_on_parent_death(int sig)
8192
{
8293
const int ppid = getppid();

0 commit comments

Comments
 (0)