Also re-run autoscan.
Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
configure.ac | 21 +++++++++------------
lib/log.c | 14 +++++---------
lib/log_dcs.c | 2 +-
tests/check_log.c | 4 ++--
tests/make-log-test | 2 +-
5 files changed, 18 insertions(+), 25 deletions(-)
diff --git a/configure.ac b/configure.ac
index 361035b..4a1efcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,20 +6,15 @@ AC_PREREQ([2.61])
AC_INIT([libqb],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[quarterback-devel(a)fedorahosted.org])
-
-AM_INIT_AUTOMAKE([-Wno-portability])
-
AC_CONFIG_SRCDIR([lib/ringbuffer.c])
AC_CONFIG_HEADERS([include/config.h include/qb/qbconfig.h])
-
+AM_INIT_AUTOMAKE([-Wno-portability])
LT_PREREQ([2.2.6])
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
-
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
-
AC_LANG([C])
dnl Fix default variables - "prefix" variable if not specified
@@ -54,12 +49,12 @@ if ! ${MAKE-make} --version /cannot/make/this >/dev/null
2>&1; then
AC_MSG_ERROR([you don't seem to have GNU make; it is required])
fi
-AC_PROG_CC
-AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_AWK
-AC_PROG_LN_S
+AC_PROG_CC
+AC_PROG_CPP
AC_PROG_INSTALL
+AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROGS([PKGCONFIG], [pkg-config])
AC_CHECK_PROGS([DOXYGEN], [doxygen])
@@ -132,16 +127,18 @@ AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
+AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_CHOWN
+AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_REALLOC
-AC_FUNC_STRERROR_R
-AC_CHECK_FUNCS([alarm clock_gettime ftruncate gettimeofday memset munmap \
- socket strchr strerror strstr epoll_create epoll_create1 \
+AC_CHECK_FUNCS([alarm clock_gettime ftruncate gettimeofday localtime_r memset munmap \
+ socket strchr strdup strerror strrchr strstr \
+ epoll_create epoll_create1 \
pthread_spin_lock timerfd_create])
## local defines
diff --git a/lib/log.c b/lib/log.c
index 4a1f881..db2b595 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -23,6 +23,8 @@
#include <link.h>
#include <stdarg.h>
+#include <dlfcn.h>
+
#include <qb/qbdefs.h>
#include <qb/qblist.h>
#include <qb/qblog.h>
@@ -421,12 +423,9 @@ int32_t qb_log_filter_ctl(int32_t t, enum qb_log_filter_conf c,
if (!logger_inited) {
return -EINVAL;
}
- if (t < 0 || t >= 32) {
+ if (t < 0 || t >= 32 || conf[t].state == QB_LOG_STATE_UNUSED) {
return -EBADF;
}
- if (conf[t].state == QB_LOG_STATE_UNUSED) {
- return -EBADFD;
- }
if (text == NULL ||
priority > LOG_TRACE ||
type > QB_LOG_FILTER_FORMAT ||
@@ -452,7 +451,7 @@ _log_so_walk_callback(struct dl_phdr_info *info, size_t size, void
*data)
void *handle;
void *start;
void *stop;
- char *error;
+ const char *error;
handle = dlopen(info->dlpi_name, RTLD_LAZY);
error = dlerror();
@@ -627,12 +626,9 @@ int32_t qb_log_ctl(int32_t t, enum qb_log_conf c, int32_t arg)
if (!logger_inited) {
return -EINVAL;
}
- if (t < 0 || t >= 32) {
+ if (t < 0 || t >= 32 || conf[t].state == QB_LOG_STATE_UNUSED) {
return -EBADF;
}
- if (conf[t].state == QB_LOG_STATE_UNUSED) {
- return -EBADFD;
- }
switch (c) {
case QB_LOG_CONF_ENABLED:
if (arg) {
diff --git a/lib/log_dcs.c b/lib/log_dcs.c
index 6dfef1e..14a8e11 100644
--- a/lib/log_dcs.c
+++ b/lib/log_dcs.c
@@ -104,7 +104,7 @@ qb_log_dcs_get(int32_t *newly_created,
uint32_t tags)
{
int32_t rc;
- struct qb_log_callsite *cs;
+ struct qb_log_callsite *cs = NULL;
struct callsite_list *csl_head;
struct callsite_list *csl_next;
struct callsite_list *csl;
diff --git a/tests/check_log.c b/tests/check_log.c
index 7fa65a3..0ada405 100644
--- a/tests/check_log.c
+++ b/tests/check_log.c
@@ -48,10 +48,10 @@ START_TEST(test_log_stupid_inputs)
/* non-opened log file */
rc = qb_log_filter_ctl(21, QB_LOG_FILTER_ADD,
QB_LOG_FILTER_FILE, "bla", LOG_TRACE);
- ck_assert_int_eq(rc, -EBADFD);
+ ck_assert_int_eq(rc, -EBADF);
rc = qb_log_ctl(21, QB_LOG_CONF_PRIORITY_BUMP, -1);
- ck_assert_int_eq(rc, -EBADFD);
+ ck_assert_int_eq(rc, -EBADF);
/* target < 0 or >= 32 */
rc = qb_log_filter_ctl(41, QB_LOG_FILTER_ADD,
diff --git a/tests/make-log-test b/tests/make-log-test
index ab27f00..8cf1a54 100755
--- a/tests/make-log-test
+++ b/tests/make-log-test
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
line=
count=0
--
1.7.4