[PATCH 1/2] fix the FIXME's Jim pointed out
by Angus Salkeld
Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
include/qb/qblog.h | 2 +-
lib/ipc_us.c | 11 +++++++++--
lib/ipcc.c | 5 ++++-
lib/ipcs.c | 9 +++++++--
lib/log.c | 20 ++++++++++++++------
lib/log_dcs.c | 6 ++++--
lib/loop_job.c | 4 +++-
lib/loop_poll.c | 4 +++-
lib/loop_timerlist.c | 4 +++-
lib/ringbuffer.c | 9 +++++++--
10 files changed, 55 insertions(+), 19 deletions(-)
diff --git a/include/qb/qblog.h b/include/qb/qblog.h
index 37f0edd..af37424 100644
--- a/include/qb/qblog.h
+++ b/include/qb/qblog.h
@@ -390,7 +390,7 @@ void qb_log_fini(void);
* qb_log_callsites_register(_start, _stop);
* @endcode
*/
-void qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_callsite *_stop);
+int32_t qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_callsite *_stop);
/**
* Dump the callsite info to stdout.
diff --git a/lib/ipc_us.c b/lib/ipc_us.c
index a3b0ae7..1220da9 100644
--- a/lib/ipc_us.c
+++ b/lib/ipc_us.c
@@ -515,6 +515,15 @@ static int32_t handle_new_connection(struct qb_ipcs_service *s,
}
c = qb_ipcs_connection_alloc(s);
+ if (c == NULL) {
+ return -ENOMEM;
+ }
+
+ c->receive_buf = malloc(req->max_msg_size);
+ if (c->receive_buf == NULL) {
+ free(c);
+ return -ENOMEM;
+ }
c->setup.u.us.sock = sock;
c->request.max_msg_size = req->max_msg_size;
c->response.max_msg_size = req->max_msg_size;
@@ -545,8 +554,6 @@ static int32_t handle_new_connection(struct qb_ipcs_service *s,
c->state = QB_IPCS_CONNECTION_ACTIVE;
qb_list_add(&c->list, &s->connections);
- c->receive_buf = malloc(c->request.max_msg_size);
- /* FIXME: c->receive_buf may be NULL, then dereferenced */
if (s->needs_sock_for_poll) {
qb_ipcs_connection_ref(c);
diff --git a/lib/ipcc.c b/lib/ipcc.c
index 6941843..095af71 100644
--- a/lib/ipcc.c
+++ b/lib/ipcc.c
@@ -48,7 +48,9 @@ qb_ipcc_connection_t *qb_ipcc_connect(const char *name, size_t max_msg_size)
c->request.max_msg_size = response.max_msg_size;
c->event.max_msg_size = response.max_msg_size;
c->receive_buf = malloc(response.max_msg_size);
- /* FIXME: handle NULL return */
+ if (c->receive_buf == NULL) {
+ goto disconnect_and_cleanup;
+ }
switch (c->type) {
case QB_IPC_SHM:
@@ -74,6 +76,7 @@ qb_ipcc_connection_t *qb_ipcc_connect(const char *name, size_t max_msg_size)
disconnect_and_cleanup:
qb_ipcc_us_sock_close(c->setup.u.us.sock);
+ free(c->receive_buf);
free(c);
errno = -res;
return NULL;
diff --git a/lib/ipcs.c b/lib/ipcs.c
index 12e8d2b..1a328ac 100644
--- a/lib/ipcs.c
+++ b/lib/ipcs.c
@@ -39,7 +39,9 @@ qb_ipcs_service_t* qb_ipcs_create(const char *name,
struct qb_ipcs_service *s;
s = calloc(1, sizeof(struct qb_ipcs_service));
- /* FIXME: handle NULL return */
+ if (s == NULL) {
+ return NULL;
+ }
s->pid = getpid();
s->type = type;
@@ -372,7 +374,10 @@ int32_t qb_ipcs_service_id_get(struct qb_ipcs_connection *c)
struct qb_ipcs_connection *qb_ipcs_connection_alloc(struct qb_ipcs_service *s)
{
struct qb_ipcs_connection *c = calloc(1, sizeof(struct qb_ipcs_connection));
- /* FIXME: handle NULL return */
+
+ if (c == NULL) {
+ return NULL;
+ }
c->refcount = 1;
c->service = s;
diff --git a/lib/log.c b/lib/log.c
index a782aed..9eeb2b5 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -212,24 +212,26 @@ void qb_log_real_(struct qb_log_callsite *cs, ...)
_log_real_msg(cs, buf);
}
-void qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_callsite *_stop)
+int32_t qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_callsite *_stop)
{
struct callsite_section *sect;
struct qb_log_target *t;
struct qb_log_filter *flt;
if (_start == NULL || _stop == NULL) {
- return;
+ return -EINVAL;
}
qb_list_for_each_entry(sect, &callsite_sections, list) {
if (sect->start == _start || sect->stop == _stop) {
- return;
+ return -EEXIST;
}
}
sect = calloc(1, sizeof(struct callsite_section));
- /* FIXME: handle NULL return */
+ if (sect == NULL) {
+ return -ENOMEM;
+ }
sect->start = _start;
sect->stop = _stop;
qb_list_init(§->list);
@@ -248,6 +250,7 @@ void qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_cal
_log_filter_apply(sect, flt->new_value, flt->conf,
flt->type, flt->text, flt->priority);
}
+ return 0;
}
void qb_log_callsites_dump(void)
@@ -322,12 +325,17 @@ static int32_t _log_filter_store(uint32_t t, enum qb_log_filter_conf c,
return -EEXIST;
}
flt = calloc(1, sizeof(struct qb_log_filter));
- /* FIXME: handle NULL return */
+ if (flt == NULL) {
+ return -ENOMEM;
+ }
qb_list_init(&flt->list);
flt->conf = c;
flt->type = type;
flt->text = strdup(text);
- /* FIXME: handle NULL return */
+ if (flt->text == NULL) {
+ free(flt);
+ return -ENOMEM;
+ }
flt->priority = priority;
flt->new_value = t;
qb_list_add_tail(&flt->list, list_head);
diff --git a/lib/log_dcs.c b/lib/log_dcs.c
index 74474ae..29dee61 100644
--- a/lib/log_dcs.c
+++ b/lib/log_dcs.c
@@ -58,10 +58,12 @@ static void _log_register_callsites(void)
(void**)&start);
if (rc == 0) {
stop = &start[callsite_elems_per_bin];
- qb_log_callsites_register(start, stop);
+ if (qb_log_callsites_register(start, stop) != 0) {
+ break;
+ }
}
+ callsite_num_bins++;
}
- callsite_num_bins = num_bins;
}
static struct qb_log_callsite *
diff --git a/lib/loop_job.c b/lib/loop_job.c
index 7dd2be4..84cba0a 100644
--- a/lib/loop_job.c
+++ b/lib/loop_job.c
@@ -61,7 +61,9 @@ struct qb_loop_source *
qb_loop_jobs_create(struct qb_loop *l)
{
struct qb_loop_source *s = malloc(sizeof(struct qb_loop_source));
- /* FIXME: handle NULL return */
+ if (s == NULL) {
+ return NULL;
+ }
s->l = l;
s->dispatch_and_take_back = job_dispatch;
s->poll = get_more_jobs;
diff --git a/lib/loop_poll.c b/lib/loop_poll.c
index bb08426..3eabd99 100644
--- a/lib/loop_poll.c
+++ b/lib/loop_poll.c
@@ -381,7 +381,9 @@ struct qb_loop_source*
qb_loop_poll_create(struct qb_loop *l)
{
struct qb_poll_source *s = malloc(sizeof(struct qb_poll_source));
- /* FIXME: handle NULL return */
+ if (s == NULL) {
+ return NULL;
+ }
s->s.l = l;
s->s.dispatch_and_take_back = _poll_dispatch_and_take_back_;
s->s.poll = _poll_and_add_to_jobs_;
diff --git a/lib/loop_timerlist.c b/lib/loop_timerlist.c
index a3debd2..2579714 100644
--- a/lib/loop_timerlist.c
+++ b/lib/loop_timerlist.c
@@ -91,7 +91,9 @@ struct qb_loop_source*
qb_loop_timer_create(struct qb_loop *l)
{
struct qb_timer_source * my_src = malloc(sizeof(struct qb_timer_source));
- /* FIXME: handle NULL return */
+ if (my_src == NULL) {
+ return NULL;
+ }
my_src->s.l = l;
my_src->s.dispatch_and_take_back = timer_dispatch;
my_src->s.poll = expire_the_timers;
diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c
index c2bf8dc..c8df73c 100644
--- a/lib/ringbuffer.c
+++ b/lib/ringbuffer.c
@@ -83,8 +83,7 @@ static void qb_rb_chunk_check(qb_ringbuffer_t * rb, uint32_t pointer);
qb_ringbuffer_t *qb_rb_open(const char *name, size_t size, uint32_t flags,
size_t shared_user_data_size)
{
- struct qb_ringbuffer_s *rb = malloc(sizeof(struct qb_ringbuffer_s));
- /* FIXME: handle NULL return */
+ struct qb_ringbuffer_s *rb;
size_t real_size = QB_ROUNDUP(size, sysconf(_SC_PAGESIZE));
char path[PATH_MAX];
int32_t fd_hdr;
@@ -99,6 +98,12 @@ qb_ringbuffer_t *qb_rb_open(const char *name, size_t size, uint32_t flags,
if (flags & QB_RB_FLAG_CREATE) {
file_flags |= O_CREAT | O_TRUNC;
}
+
+ rb = calloc(1, sizeof(struct qb_ringbuffer_s));
+ if (rb == NULL) {
+ return NULL;
+ }
+
/*
* Create a shared_hdr memory segment for the header.
*/
--
1.7.5
12 years, 11 months
[PATCH] fix some NULL-deref-upon-OOM problems
by Jim Meyering
Hello,
I've taken a look through the sources and fixed a few NULL-deref-upon-OOM
problems, when they were easy to fix (that's the first patch).
For the others (2nd patch), I've merely noted them by adding FIXME
comments, because it wasn't clear how to handle them -- i.e., if the
containing function is void, there's no easy to inform the caller of
the failure. Likewise, if the caller's return value is never checked,
there's not much point in returning NULL to indicate the failure
unless you also want to update all callers (and presumably add the
__attribute__((__warn_unused_result__)) to the function declaration
(or definition, if it's static) so that the compiler will enforce that.
BTW, I noticed at least one place where an OOM failure could result in a
failed assertion.
lib/log.c: conf[t].format = strdup(format ? format : "[%p] %b");
lib/log.c- assert(conf[t].format != NULL);
That's definitely better than dereferencing NULL, but depending on
what level of service an application using this library must provide,
an abort may be undesirable, at least when it can be provoked simply by
a low-memory condition.
If termination upon OOM is acceptable, then a noninvasive
way to code that is to use functions like xstrdup, xmalloc,
xcalloc, etc. that give a diagnostic and exit upon allocation failure.
>From 9a2b89ea3b2f3acd723bedf6fe7c7ed61e5c9f74 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 17 May 2011 11:35:48 +0200
Subject: [PATCH 1/2] avoid NULL dereference after failed malloc
* lib/util.c (qb_thread_lock_create): Handle failed malloc.
* lib/ipc_posix_mq.c (qb_ipc_pmq_sendv): Likewise.
* lib/loop_job.c (qb_loop_job_add): Likewise.
* lib/loop.c (qb_loop_create): Likewise.
---
lib/ipc_posix_mq.c | 3 +++
lib/loop.c | 3 +++
lib/loop_job.c | 3 +++
lib/util.c | 4 ++++
4 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/ipc_posix_mq.c b/lib/ipc_posix_mq.c
index 59f1f21..b61a662 100644
--- a/lib/ipc_posix_mq.c
+++ b/lib/ipc_posix_mq.c
@@ -166,6 +166,9 @@ static ssize_t qb_ipc_pmq_sendv(struct qb_ipc_one_way *one_way,
total_size += iov[i].iov_len;
}
data = malloc(total_size);
+ if (data == NULL) {
+ return -ENOMEM;
+ }
pt = data;
for (i = 0; i < iov_len; i++) {
diff --git a/lib/loop.c b/lib/loop.c
index b4f35e2..538d8a7 100644
--- a/lib/loop.c
+++ b/lib/loop.c
@@ -73,6 +73,9 @@ struct qb_loop * qb_loop_create(void)
struct qb_loop *l = malloc(sizeof(struct qb_loop));
int32_t p;
+ if (l == NULL) {
+ return NULL;
+ }
for (p = QB_LOOP_LOW; p <= QB_LOOP_HIGH; p++) {
l->level[p].priority = p;
l->level[p].to_process = 4;
diff --git a/lib/loop_job.c b/lib/loop_job.c
index 4f3ee5b..6db3bdd 100644
--- a/lib/loop_job.c
+++ b/lib/loop_job.c
@@ -87,6 +87,9 @@ int32_t qb_loop_job_add(struct qb_loop *l,
return -EINVAL;
}
job = malloc(sizeof(struct qb_loop_job));
+ if (job == NULL) {
+ return -ENOMEM;
+ }
job->dispatch_fn = dispatch_fn;
job->item.user_data = data;
diff --git a/lib/util.c b/lib/util.c
index 8ab8028..360652e 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -41,6 +41,10 @@ qb_thread_lock_t *qb_thread_lock_create(qb_thread_lock_type_t type)
struct qb_thread_lock_s *tl = malloc(sizeof(struct qb_thread_lock_s));
int32_t res;
+ if (tl == NULL) {
+ return NULL;
+ }
+
#ifdef HAVE_PTHREAD_SHARED_SPIN_LOCK
if (type == QB_THREAD_LOCK_SHORT) {
tl->type = QB_THREAD_LOCK_SHORT;
--
1.7.5.1.467.g1a85
>From 48a57ffd7f12fcd6b96345ece30435e444b6ab41 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 17 May 2011 11:39:25 +0200
Subject: [PATCH 2/2] add FIXME comments for other NULL-deref-upon-OOM
problems
* lib/ipc_us.c (handle_new_connection):
* lib/loop_job.c (qb_loop_jobs_create):
* lib/loop_poll.c (qb_loop_poll_create):
* lib/loop_timerlist.c (qb_loop_timer_create):
* lib/ringbuffer.c (qb_rb_open):
* lib/ipcc.c (qb_ipcc_connect): Likewise.
...
---
lib/ipc_us.c | 1 +
lib/ipcc.c | 1 +
lib/ipcs.c | 2 ++
lib/log.c | 3 +++
lib/loop_job.c | 1 +
lib/loop_poll.c | 1 +
lib/loop_timerlist.c | 1 +
lib/ringbuffer.c | 1 +
8 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/lib/ipc_us.c b/lib/ipc_us.c
index dc5093f..a3b0ae7 100644
--- a/lib/ipc_us.c
+++ b/lib/ipc_us.c
@@ -546,6 +546,7 @@ static int32_t handle_new_connection(struct qb_ipcs_service *s,
qb_list_add(&c->list, &s->connections);
c->receive_buf = malloc(c->request.max_msg_size);
+ /* FIXME: c->receive_buf may be NULL, then dereferenced */
if (s->needs_sock_for_poll) {
qb_ipcs_connection_ref(c);
diff --git a/lib/ipcc.c b/lib/ipcc.c
index 8ef1812..6941843 100644
--- a/lib/ipcc.c
+++ b/lib/ipcc.c
@@ -48,6 +48,7 @@ qb_ipcc_connection_t *qb_ipcc_connect(const char *name, size_t max_msg_size)
c->request.max_msg_size = response.max_msg_size;
c->event.max_msg_size = response.max_msg_size;
c->receive_buf = malloc(response.max_msg_size);
+ /* FIXME: handle NULL return */
switch (c->type) {
case QB_IPC_SHM:
diff --git a/lib/ipcs.c b/lib/ipcs.c
index 1d02879..12e8d2b 100644
--- a/lib/ipcs.c
+++ b/lib/ipcs.c
@@ -39,6 +39,7 @@ qb_ipcs_service_t* qb_ipcs_create(const char *name,
struct qb_ipcs_service *s;
s = calloc(1, sizeof(struct qb_ipcs_service));
+ /* FIXME: handle NULL return */
s->pid = getpid();
s->type = type;
@@ -371,6 +372,7 @@ int32_t qb_ipcs_service_id_get(struct qb_ipcs_connection *c)
struct qb_ipcs_connection *qb_ipcs_connection_alloc(struct qb_ipcs_service *s)
{
struct qb_ipcs_connection *c = calloc(1, sizeof(struct qb_ipcs_connection));
+ /* FIXME: handle NULL return */
c->refcount = 1;
c->service = s;
diff --git a/lib/log.c b/lib/log.c
index 52712c5..a782aed 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -229,6 +229,7 @@ void qb_log_callsites_register(struct qb_log_callsite *_start, struct qb_log_cal
}
sect = calloc(1, sizeof(struct callsite_section));
+ /* FIXME: handle NULL return */
sect->start = _start;
sect->stop = _stop;
qb_list_init(§->list);
@@ -321,10 +322,12 @@ static int32_t _log_filter_store(uint32_t t, enum qb_log_filter_conf c,
return -EEXIST;
}
flt = calloc(1, sizeof(struct qb_log_filter));
+ /* FIXME: handle NULL return */
qb_list_init(&flt->list);
flt->conf = c;
flt->type = type;
flt->text = strdup(text);
+ /* FIXME: handle NULL return */
flt->priority = priority;
flt->new_value = t;
qb_list_add_tail(&flt->list, list_head);
diff --git a/lib/loop_job.c b/lib/loop_job.c
index 6db3bdd..7dd2be4 100644
--- a/lib/loop_job.c
+++ b/lib/loop_job.c
@@ -61,6 +61,7 @@ struct qb_loop_source *
qb_loop_jobs_create(struct qb_loop *l)
{
struct qb_loop_source *s = malloc(sizeof(struct qb_loop_source));
+ /* FIXME: handle NULL return */
s->l = l;
s->dispatch_and_take_back = job_dispatch;
s->poll = get_more_jobs;
diff --git a/lib/loop_poll.c b/lib/loop_poll.c
index c02edb6..bb08426 100644
--- a/lib/loop_poll.c
+++ b/lib/loop_poll.c
@@ -381,6 +381,7 @@ struct qb_loop_source*
qb_loop_poll_create(struct qb_loop *l)
{
struct qb_poll_source *s = malloc(sizeof(struct qb_poll_source));
+ /* FIXME: handle NULL return */
s->s.l = l;
s->s.dispatch_and_take_back = _poll_dispatch_and_take_back_;
s->s.poll = _poll_and_add_to_jobs_;
diff --git a/lib/loop_timerlist.c b/lib/loop_timerlist.c
index 6f738f1..a3debd2 100644
--- a/lib/loop_timerlist.c
+++ b/lib/loop_timerlist.c
@@ -91,6 +91,7 @@ struct qb_loop_source*
qb_loop_timer_create(struct qb_loop *l)
{
struct qb_timer_source * my_src = malloc(sizeof(struct qb_timer_source));
+ /* FIXME: handle NULL return */
my_src->s.l = l;
my_src->s.dispatch_and_take_back = timer_dispatch;
my_src->s.poll = expire_the_timers;
diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c
index 4b08b93..c2bf8dc 100644
--- a/lib/ringbuffer.c
+++ b/lib/ringbuffer.c
@@ -84,6 +84,7 @@ qb_ringbuffer_t *qb_rb_open(const char *name, size_t size, uint32_t flags,
size_t shared_user_data_size)
{
struct qb_ringbuffer_s *rb = malloc(sizeof(struct qb_ringbuffer_s));
+ /* FIXME: handle NULL return */
size_t real_size = QB_ROUNDUP(size, sysconf(_SC_PAGESIZE));
char path[PATH_MAX];
int32_t fd_hdr;
--
1.7.5.1.467.g1a85
12 years, 11 months
[PATCH] avoid autoconf warning
by Jim Meyering
Running autogen.sh would print this:
configure.ac:72: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
../../lib/autoconf/lang.m4:193: AC_LANG_CONFTEST is expanded from...
../../lib/autoconf/general.m4:2589: _AC_COMPILE_IFELSE is expanded from...
../../lib/autoconf/general.m4:2605: AC_COMPILE_IFELSE is expanded from...
configure.ac:72: the top level
Here's one way to fix it:
>From b3f4e9a3e9add45961bc12a9f16cead6fa2844fb Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Tue, 17 May 2011 13:18:56 +0200
Subject: [PATCH] avoid autoconf warning
Autoconf warned about this:
configure.ac:72: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE\
call detected in body
That's warning about the use via AC_COMPILE_IFELSE without
specifying a language. The easiest way to work around that is
to avoid the use of CC altogether and instead to use the preprocessor.
* configure.ac (cc_supports_flag): Use AC_PREPROC_IFELSE in place
of AC_COMPILE_IFELSE (and CPPFLAGS in place of CFLAGS).
---
configure.ac | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 8e0cd0c..5d4672c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,9 +67,9 @@ AM_CONDITIONAL(HAVE_SPLINT, test -n "${SPLINT}")
# this function checks if CC support options passed as
# args. Global CFLAGS are ignored during this test.
cc_supports_flag() {
- local CFLAGS="$@"
+ local CPPFLAGS="$CPPFLAGS $@"
AC_MSG_CHECKING([whether $CC supports "$@"])
- AC_COMPILE_IFELSE([int main(){return 0;}] ,
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([])],
[RC=0; AC_MSG_RESULT([yes])],
[RC=1; AC_MSG_RESULT([no])])
return $RC
--
1.7.5.1.467.g1a85
12 years, 11 months
[PATCH] suggested addition: parallel-tests
by Jim Meyering
Hi Angus,
I ran "make check" in libqb and watched impatiently ;-)
as the tests ran in serial on my multi-core system.
If you add automake's "parallel-tests" option below, they'll
run in parallel.
The color-tests option makes it so the "PASS" and "FAIL" words
are colored green and red respectively. Nice, but no big deal.
Similarly nice-to-have is the "dist-xz" option.
That makes is so when you run "make dist" it creates xz-compressed
tarballs in addition to the usual gzip-compressed ones.
The advantage of also using xz is that it compresses significantly better:
$ du -sh *z
1.2M libqb-0.4.1.75-3737-dirty.tar.gz
812K libqb-0.4.1.75-3737-dirty.tar.xz
Now, whenever a project releases both gzip-compressed and
xz-compressed tarballs, I always download only the latter, smaller ones.
Not only does it save time on the download (minimal in this case),
but it occupies less space on disk and uncompresses faster.
(oh, and the first chunk below removes a trailing space)
diff --git a/configure.ac b/configure.ac
index 4a1efcf..d09990b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,12 +3,12 @@
AC_PREREQ([2.61])
-AC_INIT([libqb],
+AC_INIT([libqb],
m4_esyscmd([build-aux/git-version-gen .tarball-version]),
[quarterback-devel(a)fedorahosted.org])
AC_CONFIG_SRCDIR([lib/ringbuffer.c])
AC_CONFIG_HEADERS([include/config.h include/qb/qbconfig.h])
-AM_INIT_AUTOMAKE([-Wno-portability])
+AM_INIT_AUTOMAKE([-Wno-portability dist-xz color-tests parallel-tests])
LT_PREREQ([2.2.6])
LT_INIT
12 years, 11 months
[PATCH 1/2] LOG: make the "entering" and "leaving" capital
by Angus Salkeld
Signed-off-by: Angus Salkeld <asalkeld(a)redhat.com>
---
include/qb/qblog.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/qb/qblog.h b/include/qb/qblog.h
index 132bb54..37f0edd 100644
--- a/include/qb/qblog.h
+++ b/include/qb/qblog.h
@@ -328,8 +328,8 @@ void qb_log_from_external_source(const char *function,
#define qb_perror
#endif
-#define qb_enter() qb_log(LOG_TRACE, "entering %s()", __func__)
-#define qb_leave() qb_log(LOG_TRACE, "leaving %s()", __func__)
+#define qb_enter() qb_log(LOG_TRACE, "ENTERING %s()", __func__)
+#define qb_leave() qb_log(LOG_TRACE, "LEAVING %s()", __func__)
#define QB_LOG_SYSLOG 0
#define QB_LOG_STDERR 1
--
1.7.5
12 years, 12 months