Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
3f77cf5a
Commit
3f77cf5a
authored
Apr 13, 2016
by
Constantin Rack
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1892 from bluca/solaris_fixes
parents
f6f89a84
b1232a0f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
18 deletions
+43
-18
CMakeLists.txt
CMakeLists.txt
+4
-0
platform.hpp.in
builds/cmake/platform.hpp.in
+1
-0
configure.ac
configure.ac
+4
-2
condition_variable.hpp
src/condition_variable.hpp
+2
-2
ipc_listener.cpp
src/ipc_listener.cpp
+17
-9
ipc_listener.hpp
src/ipc_listener.hpp
+2
-1
tweetnacl.c
src/tweetnacl.c
+2
-2
test_use_fd_tcp.cpp
tests/test_use_fd_tcp.cpp
+11
-2
No files found.
CMakeLists.txt
View file @
3f77cf5a
...
...
@@ -186,6 +186,10 @@ set (CMAKE_REQUIRED_INCLUDES sys/time.h)
check_function_exists
(
gethrtime HAVE_GETHRTIME
)
set
(
CMAKE_REQUIRED_INCLUDES
)
set
(
CMAKE_REQUIRED_INCLUDES stdlib.h
)
check_function_exists
(
mkdtemp HAVE_MKDTEMP
)
set
(
CMAKE_REQUIRED_INCLUDES
)
add_definitions
(
-D_REENTRANT -D_THREAD_SAFE
)
add_definitions
(
-DZMQ_CUSTOM_PLATFORM_HPP
)
...
...
builds/cmake/platform.hpp.in
View file @
3f77cf5a
...
...
@@ -12,6 +12,7 @@
#cmakedefine HAVE_FORK
#cmakedefine HAVE_CLOCK_GETTIME
#cmakedefine HAVE_GETHRTIME
#cmakedefine HAVE_MKDTEMP
#cmakedefine ZMQ_HAVE_UIO
#cmakedefine ZMQ_HAVE_EVENTFD
...
...
configure.ac
View file @
3f77cf5a
...
...
@@ -165,7 +165,7 @@ case "${host_os}" in
;;
*solaris*)
# Define on Solaris to enable all library features
CPPFLAGS="-D_PTHREADS $CPPFLAGS"
CPPFLAGS="-
Wno-sign-compare -
D_PTHREADS $CPPFLAGS"
AC_DEFINE(ZMQ_HAVE_SOLARIS, 1, [Have Solaris OS])
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(nsl, gethostbyname)
...
...
@@ -446,6 +446,8 @@ elif test "x$with_libsodium" = "xyes"; then
case "${host_os}" in
*solaris*)
LDFLAGS="-lssp $LDFLAGS"
libzmq_pedantic="no"
libzmq_werror="no"
;;
esac
else
...
...
@@ -561,7 +563,7 @@ AC_LANG_POP([C++])
# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork posix_memalign)
AC_CHECK_FUNCS(perror gettimeofday clock_gettime memset socket getifaddrs freeifaddrs fork posix_memalign
mkdtemp
)
AC_CHECK_HEADERS([alloca.h])
LIBZMQ_CHECK_SOCK_CLOEXEC([
...
...
src/condition_variable.hpp
View file @
3f77cf5a
...
...
@@ -165,9 +165,9 @@ namespace zmq
timeout
.
tv_sec
+=
timeout_
/
1000
;
timeout
.
tv_nsec
+=
(
timeout_
%
1000
)
*
1000000
;
if
(
timeout
.
tv_nsec
>
1
E9
)
{
if
(
timeout
.
tv_nsec
>
1
000000000
)
{
timeout
.
tv_sec
++
;
timeout
.
tv_nsec
-=
1
E9
;
timeout
.
tv_nsec
-=
1
000000000
;
}
rc
=
pthread_cond_timedwait
(
&
cond
,
mutex_
->
get_mutex
(),
&
timeout
);
...
...
src/ipc_listener.cpp
View file @
3f77cf5a
...
...
@@ -71,7 +71,8 @@ const char *zmq::ipc_listener_t::tmp_env_vars[] = {
0
// Sentinel
};
int
zmq
::
ipc_listener_t
::
create_wildcard_address
(
std
::
string
&
path_
)
int
zmq
::
ipc_listener_t
::
create_wildcard_address
(
std
::
string
&
path_
,
std
::
string
&
file_
)
{
std
::
string
tmp_path
;
...
...
@@ -101,6 +102,7 @@ int zmq::ipc_listener_t::create_wildcard_address(std::string& path_)
std
::
vector
<
char
>
buffer
(
tmp_path
.
length
()
+
1
);
strcpy
(
buffer
.
data
(),
tmp_path
.
c_str
());
#ifdef HAVE_MKDTEMP
// Create the directory. POSIX requires that mkdtemp() creates the
// directory with 0700 permissions, meaning the only possible race
// with socket creation could be the same user. However, since
...
...
@@ -112,6 +114,18 @@ int zmq::ipc_listener_t::create_wildcard_address(std::string& path_)
}
path_
.
assign
(
buffer
.
data
());
file_
.
assign
(
path_
+
"/socket"
);
#else
// Silence -Wunused-parameter. #pragma and __attribute__((unused)) are not
// very portable unfortunately...
(
void
)
path_
;
int
fd
=
mkstemp
(
buffer
.
data
());
if
(
fd
==
-
1
)
return
-
1
;
::
close
(
fd
);
file_
.
assign
(
buffer
.
data
());
#endif
return
0
;
}
...
...
@@ -200,16 +214,10 @@ int zmq::ipc_listener_t::set_address (const char *addr_)
std
::
string
addr
(
addr_
);
// Allow wildcard file
if
(
addr
[
0
]
==
'*'
)
{
std
::
string
tmp_path
;
if
(
create_wildcard_address
(
tmp_path
)
<
0
)
{
if
(
options
.
use_fd
==
-
1
&&
addr
[
0
]
==
'*'
)
{
if
(
create_wildcard_address
(
tmp_socket_dirname
,
addr
)
<
0
)
{
return
-
1
;
}
tmp_socket_dirname
.
assign
(
tmp_path
);
addr
.
assign
(
tmp_path
+
"/socket"
);
}
// Get rid of the file associated with the UNIX domain socket that
...
...
src/ipc_listener.hpp
View file @
3f77cf5a
...
...
@@ -74,7 +74,8 @@ namespace zmq
int
close
();
// Create wildcard path address
static
int
create_wildcard_address
(
std
::
string
&
path_
);
static
int
create_wildcard_address
(
std
::
string
&
path_
,
std
::
string
&
file_
);
// Filter new connections if the OS provides a mechanism to get
// the credentials of the peer process. Called from accept().
...
...
src/tweetnacl.c
View file @
3f77cf5a
...
...
@@ -32,9 +32,9 @@
/*
Disable warnings for this source only, rather than for the whole
codebase when building with C99 or with Microsoft's compiler
codebase when building with C99
(gcc >= 4.2)
or with Microsoft's compiler
*/
#if defined __GNUC__ && __STDC_VERSION__ < 201112L
#if defined __GNUC__ &&
(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) &&
__STDC_VERSION__ < 201112L
# pragma GCC diagnostic ignored "-Wsign-compare"
#elif defined _MSC_VER
# pragma warning (disable:4018 4244 4146)
...
...
tests/test_use_fd_tcp.cpp
View file @
3f77cf5a
...
...
@@ -35,8 +35,17 @@
void
pre_allocate_sock
(
void
*
zmq_socket
,
const
char
*
address
,
const
char
*
port
)
{
struct
addrinfo
*
addr
;
int
rc
=
getaddrinfo
(
address
,
port
,
NULL
,
&
addr
);
struct
addrinfo
*
addr
,
hint
;
hint
.
ai_flags
=
0
;
hint
.
ai_family
=
AF_INET
;
hint
.
ai_socktype
=
SOCK_STREAM
;
hint
.
ai_protocol
=
IPPROTO_TCP
;
hint
.
ai_addrlen
=
0
;
hint
.
ai_canonname
=
NULL
;
hint
.
ai_addr
=
NULL
;
hint
.
ai_next
=
NULL
;
int
rc
=
getaddrinfo
(
address
,
port
,
&
hint
,
&
addr
);
assert
(
rc
==
0
);
int
s_pre
=
socket
(
AF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment