Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
configure.ac | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index b97ed8f..16f15a7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,22 +153,21 @@ AC_CHECK_MEMBER([struct sockaddr_un.sun_len],
[],
[#include <sys/un.h>])
-
AC_MSG_CHECKING(looking for union semun in sys/sem.h)
-AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/sem.h>
-],[
-union semun arg;
-semctl(0, 0, 0, arg);
-], [have_union_semun="1" union_semun=yes ]
-msg=yes, [
-have_union_semun="0"
-msg=no ] )
-AC_MSG_RESULT([$msg])
-AM_CONDITIONAL(HAVE_SEMUN,
- [test "x$have_union_semun" = xyes])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+[[#include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/sem.h>]],
+[[union semun arg; semctl(0, 0, 0, arg);]])],
+ [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE_UNQUOTED([HAVE_SEMUN], 1, [Define to 1 if you have union
semun.])
+ ],
+ [
+ AC_MSG_RESULT([no])
+ ]
+ )
+
# Checks for library functions.
AC_FUNC_CHOWN
--
1.7.10.2
Show replies by date
Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
lib/array.c | 2 +-
lib/log_dcs.c | 2 +-
tests/rbwriter.c | 2 ++
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/array.c b/lib/array.c
index a97bbd3..d091f17 100644
--- a/lib/array.c
+++ b/lib/array.c
@@ -103,7 +103,7 @@ qb_array_index(struct qb_array * a, int32_t idx, void **element_out)
int32_t b;
int32_t elem;
char *bin;
- int32_t rc;
+ int32_t rc = 0;
if (a == NULL || element_out == NULL) {
return -EINVAL;
diff --git a/lib/log_dcs.c b/lib/log_dcs.c
index fae1ffe..e59f57f 100644
--- a/lib/log_dcs.c
+++ b/lib/log_dcs.c
@@ -113,7 +113,7 @@ qb_log_dcs_get(int32_t * newly_created,
int32_t rc;
struct qb_log_callsite *cs = NULL;
struct callsite_list *csl_head;
- struct callsite_list *csl_last;
+ struct callsite_list *csl_last = NULL;
struct callsite_list *csl;
const char *safe_filename = filename;
const char *safe_function = function;
diff --git a/tests/rbwriter.c b/tests/rbwriter.c
index 86386dd..616a6c1 100644
--- a/tests/rbwriter.c
+++ b/tests/rbwriter.c
@@ -40,6 +40,7 @@ static qb_ringbuffer_t *rb = NULL;
#define ONE_MEG 1048576
static char buffer[ONE_MEG * 3];
+#ifndef timersub
#define timersub(a, b, result) \
do { \
(result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
@@ -49,6 +50,7 @@ do { \
(result)->tv_usec += 1000000; \
} \
} while (0)
+#endif
static void sigalrm_handler (int num)
{
--
1.7.10.2