Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,22 @@ dnl command line
dnl Wrap in m4_ifdef to avoid breaking on older platforms
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
LT_PREREQ([2.2.6])

AC_CANONICAL_HOST

# --enable-new-dtags: Use RUNPATH instead of RPATH.
# It is necessary to have this done before libtool does linker detection.
# See also: https://github.com/kronosnet/kronosnet/issues/107
AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags],
[AM_LDFLAGS=-Wl,--enable-new-dtags],
[AC_MSG_ERROR(["Linker support for --enable-new-dtags is required"])])
case "$host_os" in
solaris*)
AC_MSG_NOTICE([Skipping --enable-new-dtags check, Solaris' RPATH logic is like RUNPATH on other platforms])
;;
*)
AX_CHECK_LINK_FLAG([-Wl,--enable-new-dtags],
[AM_LDFLAGS=-Wl,--enable-new-dtags],
[AC_MSG_ERROR(["Linker support for --enable-new-dtags is required"])])
;;
esac
AC_SUBST([AM_LDFLAGS])
saved_LDFLAGS="$LDFLAGS"
LDFLAGS="$AM_LDFLAGS $LDFLAGS"
Expand Down
2 changes: 2 additions & 0 deletions doxygen2man/doxygen2man.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#define _GNU_SOURCE
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#define _XPG4_2
#define _XPG7
#include <stdlib.h>
#include <sys/time.h>
#include <sys/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/ipcclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ _benchmark(qb_ipcc_connection_t *conn, int write_size)
hdr.size = write_size;
hdr.id = QB_IPC_MSG_USER_START + 1;

iov[0].iov_base = &hdr;
iov[0].iov_base = (void*)&hdr;
iov[0].iov_len = sizeof(struct qb_ipc_request_header);

iov[1].iov_base = data;
Expand Down
4 changes: 2 additions & 2 deletions examples/ipcserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ s1_msg_process_fn(qb_ipcs_connection_t * c, void *data, size_t size)

sl = snprintf(resp, 100, "ACK %zu bytes", size) + 1;
iov[0].iov_len = sizeof(response);
iov[0].iov_base = &response;
iov[0].iov_base = (void*)&response;
iov[1].iov_len = sl;
iov[1].iov_base = resp;
response.size += sl;
Expand Down Expand Up @@ -365,7 +365,7 @@ main(int32_t argc, char *argv[])
qb_log_format_set(QB_LOG_STDERR, "%f:%l [%p] %b");
qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_ENABLED, QB_TRUE);

s1 = qb_ipcs_create("ipcserver", 0, ipc_type, &sh);
s1 = qb_ipcs_create("123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", 0, ipc_type, &sh);
if (s1 == 0) {
qb_perror(LOG_ERR, "qb_ipcs_create");
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion lib/ipc_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ init_ipc_auth_data(int sock, size_t len)
#endif /* QB_SOLARIS */

data->len = len;
data->iov_recv.iov_base = &data->msg;
data->iov_recv.iov_base = (void *)&data->msg;
data->iov_recv.iov_len = data->len;
data->sock = sock;

Expand Down
4 changes: 2 additions & 2 deletions lib/unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open_mmap_file(char *path, uint32_t file_flags)
return open(path, file_flags, 0600);
}

#if defined(QB_BSD) || !defined(HAVE_POSIX_FALLOCATE)
#if defined(QB_BSD) || defined(QB_SOLARIS) || !defined(HAVE_POSIX_FALLOCATE)
static int local_fallocate(int fd, size_t bytes)
{
long page_size = sysconf(_SC_PAGESIZE);
Expand Down Expand Up @@ -170,7 +170,7 @@ qb_sys_mmap_file_open(char *path, const char *file, size_t bytes,
if (res == EINTR) {
qb_util_log(LOG_DEBUG, "got EINTR trying to allocate file %s, retrying...", path);
continue;
#ifdef QB_BSD
#if defined (QB_BSD) || defined(QB_SOLARIS)
} else if (res == EINVAL) { /* posix_fallocate() fails on ZFS
https://lists.freebsd.org/pipermail/freebsd-current/2018-February/068448.html */
qb_util_log(LOG_DEBUG, "posix_fallocate returned EINVAL - running on ZFS?");
Expand Down
18 changes: 11 additions & 7 deletions tests/check_ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ set_ipc_name(const char *prefix)
f = fopen(IPC_TEST_NAME_FILE, "r");
if (f) {
fgets(process_name, sizeof(process_name), f);
/* Remove any trailing LF that might be lurking */
if (process_name[strlen(process_name)-1] == '\n') {
process_name[strlen(process_name)-1] = '\0';
}
fclose(f);
snprintf(ipc_name, sizeof(ipc_name), "%.44s%s", prefix, process_name);
} else {
Expand Down Expand Up @@ -890,7 +894,7 @@ request_server_exit(void)
req_header.size = sizeof(struct qb_ipc_request_header);

iov[0].iov_len = req_header.size;
iov[0].iov_base = &req_header;
iov[0].iov_base = (void*)&req_header;

ck_assert_int_eq(QB_TRUE, qb_ipcc_is_connected(conn));

Expand Down Expand Up @@ -1048,7 +1052,7 @@ static void test_ipc_connect_async(void)
req_header.size = sizeof(struct qb_ipc_request_header);

iov[0].iov_len = req_header.size;
iov[0].iov_base = &req_header;
iov[0].iov_base = (void*)&req_header;

res = qb_ipcc_sendv_recv(conn, iov, 1,
&res_header,
Expand Down Expand Up @@ -1096,7 +1100,7 @@ test_ipc_txrx_timeout(void)
req_header.size = sizeof(struct qb_ipc_request_header);

iov[0].iov_len = req_header.size;
iov[0].iov_base = &req_header;
iov[0].iov_base = (void*)&req_header;

res = qb_ipcc_sendv_recv(conn, iov, 1,
&res_header,
Expand Down Expand Up @@ -1234,7 +1238,7 @@ test_ipc_exit(void)
req_header.size = sizeof(struct qb_ipc_request_header);

iov[0].iov_len = req_header.size;
iov[0].iov_base = &req_header;
iov[0].iov_base = (void*)&req_header;

res = qb_ipcc_sendv_recv(conn, iov, 1,
&res_header,
Expand Down Expand Up @@ -1306,7 +1310,7 @@ END_TEST
START_TEST(test_ipc_us_connect_async)
{
qb_enter();
ipc_type = QB_IPC_SHM;
ipc_type = QB_IPC_SOCKET;
set_ipc_name(__func__);
test_ipc_connect_async();
qb_leave();
Expand Down Expand Up @@ -1729,7 +1733,7 @@ test_ipc_stress_test(void)
}

iov[0].iov_len = giant_req.hdr.size;
iov[0].iov_base = &giant_req;
iov[0].iov_base = (void*)&giant_req;
res = qb_ipcc_sendv_recv(conn, iov, 1,
&res_header,
sizeof(struct qb_ipc_response_header), -1);
Expand Down Expand Up @@ -1949,7 +1953,7 @@ test_ipc_disconnect_after_created(void)
req_header.size = sizeof(struct qb_ipc_request_header);

iov[0].iov_len = req_header.size;
iov[0].iov_base = &req_header;
iov[0].iov_base = (void*)&req_header;

res = qb_ipcc_sendv_recv(conn, iov, 1,
&res_header,
Expand Down
4 changes: 2 additions & 2 deletions tests/start.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#

testname=$(echo `uuidgen | sed -e "s#-.*##g"`-`date +%s`)
echo -n $testname > ipc-test-name
echo $testname > ipc-test-name
testname=$(echo `uuidgen | sed -e "s#-.*##g"`-`date +%s`)
echo -n $testname > ipc-test-name-sock
echo $testname > ipc-test-name-sock

mkdir -p $SOCKETDIR