Code

Use sdb_error_chomp() to remove newlines from multi-part messages.
authorSebastian Harl <sh@tokkee.org>
Wed, 20 Mar 2013 07:03:42 +0000 (00:03 -0700)
committerSebastian Harl <sh@tokkee.org>
Wed, 20 Mar 2013 07:03:42 +0000 (00:03 -0700)
The actual logging callback should take care of handling that appropriately in
these cases as well.

src/daemon/config.c
src/utils/dbi.c

index bb80d3b93afcd61d8d47d5610dfceedee34efbe6..ac95b6c6370a653940e2cd66daf52aa48af0fcc5 100644 (file)
@@ -187,6 +187,7 @@ daemon_parse_config(const char *filename)
                                sdb_error_append("\tUnknown option '%s' -- "
                                                "see the documentation for details\n",
                                                child->key);
+                       sdb_error_chomp();
                        sdb_error_log(SDB_LOG_ERR);
                        retval = -1;
                }
index 5188058866ae4685cdddf88a46d653a73a0fe7ad..f89e46356a8d1b9c2d9ae4dbbcc6aa9141aa9c99 100644 (file)
@@ -298,6 +298,7 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client)
                                driver = dbi_driver_list(driver)) {
                        sdb_error_append("\t- %s\n", dbi_driver_get_name(driver));
                }
+               sdb_error_chomp();
                sdb_error_log(SDB_LOG_ERR);
                return -1;
        }
@@ -327,6 +328,7 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client)
                        for (opt = dbi_conn_get_option_list(client->conn, NULL); opt;
                                        opt = dbi_conn_get_option_list(client->conn, opt))
                                sdb_error_append("\t- %s\n", opt);
+                       sdb_error_chomp();
                        sdb_error_log(SDB_LOG_ERR);
 
                        dbi_conn_close(client->conn);