diff options
| author | Martin Schwenke <martin@meltin.net> | 2011-11-09 15:20:07 +1100 |
|---|---|---|
| committer | Martin Schwenke <martin@meltin.net> | 2011-11-09 15:20:07 +1100 |
| commit | c1e8ea08e38464243f1d6b4079413ee431410c6d (patch) | |
| tree | 35d0410ea87a243bf86b530b049a6d2e9d8bbd0d /ctdb/tests/src/ctdb_bench.c | |
| parent | 3b47e5fa491360af5d3c94fbb5bb21fe6271962b (diff) | |
| download | samba-c1e8ea08e38464243f1d6b4079413ee431410c6d.tar.gz samba-c1e8ea08e38464243f1d6b4079413ee431410c6d.tar.xz samba-c1e8ea08e38464243f1d6b4079413ee431410c6d.zip | |
Clean up warnings: log some unchecked return codes from function calls
In a few places functions are called, the return code is assigned into
a variable but it is not checked. This generates a compiler warning
like this:
warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
Instead we remove the warning by checking the return code variable and
log a warning at DEBUG level if the return code indicates an error.
The justification is that there may have been a future intent to check
the return code but it hasn't been important enough to follow-up. If
it matters, it will be logged for easy debugging.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 1932466c76de2b184c2a257120768ab8c9d6c12a)
Diffstat (limited to 'ctdb/tests/src/ctdb_bench.c')
| -rw-r--r-- | ctdb/tests/src/ctdb_bench.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ctdb/tests/src/ctdb_bench.c b/ctdb/tests/src/ctdb_bench.c index 8e0e0d7956..14d25a138f 100644 --- a/ctdb/tests/src/ctdb_bench.c +++ b/ctdb/tests/src/ctdb_bench.c @@ -234,7 +234,13 @@ int main(int argc, const char *argv[]) /* setup a ctdb call function */ ret = ctdb_set_call(ctdb_db, incr_func, FUNC_INCR); + if (ret != 0) { + DEBUG(DEBUG_DEBUG,("ctdb_set_call() failed, ignoring return code %d\n", ret)); + } ret = ctdb_set_call(ctdb_db, fetch_func, FUNC_FETCH); + if (ret != 0) { + DEBUG(DEBUG_DEBUG,("ctdb_set_call() failed, ignoring return code %d\n", ret)); + } if (ctdb_client_set_message_handler(ctdb, 0, ring_message_handler,&msg_count)) goto error; |
