mirror of
https://github.com/debauchee/barrier.git
synced 2026-11-28 14:55:38 +08:00
Fixes to compile on solaris 9 using g++.
This commit is contained in:
@@ -34,6 +34,9 @@
|
||||
|
||||
#if HAVE_POLL
|
||||
# include <sys/poll.h>
|
||||
# if HAVE_ALLOCA_H
|
||||
# include <alloca.h>
|
||||
# endif
|
||||
#else
|
||||
# if HAVE_SYS_SELECT_H
|
||||
# include <sys/select.h>
|
||||
@@ -43,6 +46,13 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_ALLOCA_H
|
||||
# define freea(x_)
|
||||
#else
|
||||
# define alloca(x_) malloc(x_)
|
||||
# define freea(x_) free(x_)
|
||||
#endif
|
||||
|
||||
static const int s_family[] = {
|
||||
PF_UNSPEC,
|
||||
PF_INET
|
||||
@@ -327,8 +337,10 @@ CArchNetworkBSD::pollSocket(CPollEntry pe[], int num, double timeout)
|
||||
if (errno == EINTR) {
|
||||
// interrupted system call
|
||||
ARCH->testCancelThread();
|
||||
freea(pfd);
|
||||
return 0;
|
||||
}
|
||||
freea(pfd);
|
||||
throwError(errno);
|
||||
}
|
||||
|
||||
@@ -349,6 +361,7 @@ CArchNetworkBSD::pollSocket(CPollEntry pe[], int num, double timeout)
|
||||
}
|
||||
}
|
||||
|
||||
freea(pfd);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user