com_init(): Return proper error code.
authorAndre Noll <maan@systemlinux.org>
Sun, 11 Dec 2011 19:24:53 +0000 (20:24 +0100)
committerAndre Noll <maan@systemlinux.org>
Wed, 4 Jan 2012 14:44:25 +0000 (15:44 +0100)
If an error occurred during database initialization, we send an error
message to the client.  However, it this fails, we currently log
the send error rather than the error that caused that initialization
to fail. Fix this by logging the root cause of the problem instead.

afs.c

diff --git a/afs.c b/afs.c
index ff3c95f..10f9fa2 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -1049,7 +1049,8 @@ int com_init(struct stream_cipher_context *scc, int argc, char * const * const a
        ret = send_callback_request(create_tables_callback, &query,
                sc_send_result, scc);
        if (ret < 0)
-               return sc_send_va_buffer(scc, "%s\n", para_strerror(-ret));
+               /* ignore return value */
+               sc_send_va_buffer(scc, "%s\n", para_strerror(-ret));
        return ret;
 }