From: Sebastian Harl Date: Wed, 20 Mar 2013 06:48:10 +0000 (-0700) Subject: Removed newline at the end of sdb_log()'ed strings. X-Git-Tag: sysdb-0.1.0~422 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=be63d81ac212b97d79b478634dc86c141992cef8;p=sysdb.git Removed newline at the end of sdb_log()'ed strings. The actual logging callback should take care of handling that appropriately. --- diff --git a/src/backend/collectd/unixsock.c b/src/backend/collectd/unixsock.c index 01c2f25..f9741fe 100644 --- a/src/backend/collectd/unixsock.c +++ b/src/backend/collectd/unixsock.c @@ -76,14 +76,14 @@ sdb_collectd_add_host(const char *hostname, sdb_time_t last_update) if (status < 0) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to " - "store/update host '%s'.\n", name); + "store/update host '%s'.", name); return -1; } else if (status > 0) /* value too old */ return 0; sdb_log(SDB_LOG_DEBUG, "collectd::unixsock backend: Added/updated " - "host '%s' (last update timestamp = %"PRIscTIME").\n", + "host '%s' (last update timestamp = %"PRIscTIME").", name, last_update); return 0; } /* sdb_collectd_add_host */ @@ -108,7 +108,7 @@ sdb_collectd_add_svc(const char *hostname, const char *plugin, status = sdb_store_service(&svc); if (status < 0) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to " - "store/update service '%s/%s'.\n", host, name); + "store/update service '%s/%s'.", host, name); return -1; } return 0; @@ -148,7 +148,7 @@ sdb_collectd_get_data(sdb_unixsock_client_t __attribute__((unused)) *client, if (! state->current_host) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to allocate " - "string buffer: %s\n", + "string buffer: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -171,7 +171,7 @@ sdb_collectd_get_data(sdb_unixsock_client_t __attribute__((unused)) *client, sdb_collectd_add_host(hostname, last_update); sdb_log(SDB_LOG_DEBUG, "collectd::unixsock backend: Added/updated " - "%i service%s (%i failed) for host '%s'.\n", + "%i service%s (%i failed) for host '%s'.", state->svc_updated, state->svc_updated == 1 ? "" : "s", state->svc_failed, state->current_host); state->svc_updated = state->svc_failed = 0; @@ -197,12 +197,12 @@ sdb_collectd_init(sdb_object_t *user_data) client = SDB_OBJ_WRAPPER(user_data)->data; if (sdb_unixsock_client_connect(client)) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: " - "Failed to connect to collectd.\n"); + "Failed to connect to collectd."); return -1; } sdb_log(SDB_LOG_INFO, "collectd::unixsock backend: Successfully " - "connected to collectd @ %s.\n", + "connected to collectd @ %s.", sdb_unixsock_client_path(client)); return 0; } /* sdb_collectd_init */ @@ -236,7 +236,7 @@ sdb_collectd_collect(sdb_object_t *user_data) if (sdb_unixsock_client_send(client, "LISTVAL") <= 0) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to send " - "LISTVAL command to collectd @ %s.\n", + "LISTVAL command to collectd @ %s.", sdb_unixsock_client_path(client)); return -1; } @@ -244,7 +244,7 @@ sdb_collectd_collect(sdb_object_t *user_data) line = sdb_unixsock_client_recv(client, buffer, sizeof(buffer)); if (! line) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to read " - "status of LISTVAL command from collectd @ %s.\n", + "status of LISTVAL command from collectd @ %s.", sdb_unixsock_client_path(client)); return -1; } @@ -259,14 +259,14 @@ sdb_collectd_collect(sdb_object_t *user_data) count = strtol(line, &endptr, /* base */ 0); if (errno || (line == endptr)) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to parse " - "status of LISTVAL command from collectd @ %s.\n", + "status of LISTVAL command from collectd @ %s.", sdb_unixsock_client_path(client)); return -1; } if (count < 0) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to get " - "value list from collectd @ %s: %s\n", + "value list from collectd @ %s: %s", sdb_unixsock_client_path(client), msg ? msg : line); return -1; @@ -278,7 +278,7 @@ sdb_collectd_collect(sdb_object_t *user_data) SDB_TYPE_DATETIME, SDB_TYPE_STRING, SDB_TYPE_STRING, SDB_TYPE_STRING)) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed " - "to read response from collectd @ %s.\n", + "to read response from collectd @ %s.", sdb_unixsock_client_path(client)); return -1; } @@ -286,7 +286,7 @@ sdb_collectd_collect(sdb_object_t *user_data) if (state.current_host) { sdb_collectd_add_host(state.current_host, state.current_timestamp); sdb_log(SDB_LOG_DEBUG, "collectd::unixsock backend: Added/updated " - "%i service%s (%i failed) for host '%s'.\n", + "%i service%s (%i failed) for host '%s'.", state.svc_updated, state.svc_updated == 1 ? "" : "s", state.svc_failed, state.current_host); } @@ -308,7 +308,7 @@ sdb_collectd_config_instance(oconfig_item_t *ci) if (oconfig_get_string(ci, &name)) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Instance requires " - "a single string argument\n\tUsage: \n"); + "a single string argument\n\tUsage: "); return -1; } @@ -319,13 +319,13 @@ sdb_collectd_config_instance(oconfig_item_t *ci) oconfig_get_string(child, &socket_path); else sdb_log(SDB_LOG_WARNING, "collectd::unixsock backend: Ignoring " - "unknown config option '%s' inside .\n", + "unknown config option '%s' inside .", child->key, name); } if (! socket_path) { sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Instance '%s' " - "missing the 'Socket' option.\n", name); + "missing the 'Socket' option.", name); return -1; } @@ -336,7 +336,7 @@ sdb_collectd_config_instance(oconfig_item_t *ci) if (! client) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to create " - "unixsock client: %s\n", + "unixsock client: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -346,7 +346,7 @@ sdb_collectd_config_instance(oconfig_item_t *ci) if (! user_data) { sdb_unixsock_client_destroy(client); sdb_log(SDB_LOG_ERR, "collectd::unixsock backend: Failed to allocate " - "sdb_object_t\n"); + "sdb_object_t"); return -1; } @@ -373,7 +373,7 @@ sdb_collectd_config(oconfig_item_t *ci) sdb_collectd_config_instance(child); else sdb_log(SDB_LOG_WARNING, "collectd::unixsock backend: Ignoring " - "unknown config option '%s'.\n", child->key); + "unknown config option '%s'.", child->key); } return 0; } /* sdb_collectd_config */ diff --git a/src/backend/mk-livestatus.c b/src/backend/mk-livestatus.c index adc9cee..6de35cb 100644 --- a/src/backend/mk-livestatus.c +++ b/src/backend/mk-livestatus.c @@ -73,7 +73,7 @@ sdb_livestatus_get_host(sdb_unixsock_client_t __attribute__((unused)) *client, if (status < 0) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to " - "store/update host '%s'.\n", hostname); + "store/update host '%s'.", hostname); free(hostname); return -1; } @@ -81,7 +81,7 @@ sdb_livestatus_get_host(sdb_unixsock_client_t __attribute__((unused)) *client, return 0; sdb_log(SDB_LOG_DEBUG, "MK Livestatus backend: Added/updated " - "host '%s' (last update timestamp = %"PRIscTIME").\n", + "host '%s' (last update timestamp = %"PRIscTIME").", hostname, timestamp); free(hostname); return 0; @@ -117,7 +117,7 @@ sdb_livestatus_get_svc(sdb_unixsock_client_t __attribute__((unused)) *client, if (status < 0) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to " - "store/update service '%s / %s'.\n", hostname, svcname); + "store/update service '%s / %s'.", hostname, svcname); free(hostname); free(svcname); return -1; @@ -126,7 +126,7 @@ sdb_livestatus_get_svc(sdb_unixsock_client_t __attribute__((unused)) *client, return 0; sdb_log(SDB_LOG_DEBUG, "MK Livestatus backend: Added/updated " - "service '%s / %s' (last update timestamp = %"PRIscTIME").\n", + "service '%s / %s' (last update timestamp = %"PRIscTIME").", hostname, svcname, timestamp); free(hostname); free(svcname); @@ -148,13 +148,13 @@ sdb_livestatus_init(sdb_object_t *user_data) client = SDB_OBJ_WRAPPER(user_data)->data; if (sdb_unixsock_client_connect(client)) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: " - "Failed to connect to livestatus @ %s.\n", + "Failed to connect to livestatus @ %s.", sdb_unixsock_client_path(client)); return -1; } sdb_log(SDB_LOG_INFO, "MK Livestatus backend: Successfully " - "connected to livestatus @ %s.\n", + "connected to livestatus @ %s.", sdb_unixsock_client_path(client)); return 0; } /* sdb_livestatus_init */ @@ -175,7 +175,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) "Columns: name last_check"); if (status <= 0) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to send " - "'GET hosts' command to livestatus @ %s.\n", + "'GET hosts' command to livestatus @ %s.", sdb_unixsock_client_path(client)); return -1; } @@ -186,7 +186,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) /* user data */ NULL, /* -> EOF */ -1, /* delim */ ";", /* column count */ 2, SDB_TYPE_STRING, SDB_TYPE_DATETIME)) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to read " - "response from livestatus @ %s while reading hosts.\n", + "response from livestatus @ %s while reading hosts.", sdb_unixsock_client_path(client)); return -1; } @@ -195,7 +195,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) || sdb_unixsock_client_error(client)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to read " - "host from livestatus @ %s: %s\n", + "host from livestatus @ %s: %s", sdb_unixsock_client_path(client), sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; @@ -205,7 +205,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) "Columns: host_name description last_check"); if (status <= 0) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to send " - "'GET services' command to livestatus @ %s.\n", + "'GET services' command to livestatus @ %s.", sdb_unixsock_client_path(client)); return -1; } @@ -217,7 +217,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) /* column count */ 3, SDB_TYPE_STRING, SDB_TYPE_STRING, SDB_TYPE_DATETIME)) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to read " - "response from livestatus @ %s while reading services.\n", + "response from livestatus @ %s while reading services.", sdb_unixsock_client_path(client)); return -1; } @@ -226,7 +226,7 @@ sdb_livestatus_collect(sdb_object_t *user_data) || sdb_unixsock_client_error(client)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to read " - "services from livestatus @ %s: %s\n", + "services from livestatus @ %s: %s", sdb_unixsock_client_path(client), sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; @@ -249,7 +249,7 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) if (oconfig_get_string(ci, &name)) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Instance requires " - "a single string argument\n\tUsage: \n"); + "a single string argument\n\tUsage: "); return -1; } @@ -260,13 +260,13 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) oconfig_get_string(child, &socket_path); else sdb_log(SDB_LOG_WARNING, "MK Livestatus backend: Ignoring " - "unknown config option '%s' inside .\n", + "unknown config option '%s' inside .", child->key, name); } if (! socket_path) { sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Instance '%s' " - "missing the 'Socket' option.\n", name); + "missing the 'Socket' option.", name); return -1; } @@ -277,7 +277,7 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) if (! client) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to create " - "unixsock client: %s\n", + "unixsock client: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -287,7 +287,7 @@ sdb_livestatus_config_instance(oconfig_item_t *ci) if (! user_data) { sdb_unixsock_client_destroy(client); sdb_log(SDB_LOG_ERR, "MK Livestatus backend: Failed to " - "allocate sdb_object_t\n"); + "allocate sdb_object_t"); return -1; } @@ -312,7 +312,7 @@ sdb_livestatus_config(oconfig_item_t *ci) sdb_livestatus_config_instance(child); else sdb_log(SDB_LOG_WARNING, "MK Livestatus backend: Ignoring " - "unknown config option '%s'.\n", child->key); + "unknown config option '%s'.", child->key); } return 0; } /* sdb_livestatus_config */ diff --git a/src/backend/puppet/store-configs.c b/src/backend/puppet/store-configs.c index 601bc06..8d7a8eb 100644 --- a/src/backend/puppet/store-configs.c +++ b/src/backend/puppet/store-configs.c @@ -67,14 +67,14 @@ sdb_puppet_stcfg_get_hosts(sdb_dbi_client_t __attribute__((unused)) *client, if (status < 0) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Failed to " - "store/update host '%s'.\n", host.host_name); + "store/update host '%s'.", host.host_name); free(host.host_name); return -1; } else if (! status) sdb_log(SDB_LOG_DEBUG, "puppet::store-configs backend: " "Added/updated host '%s' (last update timestamp = " - "%"PRIscTIME").\n", host.host_name, host.host_last_update); + "%"PRIscTIME").", host.host_name, host.host_last_update); free(host.host_name); return 0; } /* sdb_puppet_stcfg_get_hosts */ @@ -103,7 +103,7 @@ sdb_puppet_stcfg_get_attrs(sdb_dbi_client_t __attribute__((unused)) *client, if (status < 0) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Failed to " - "store/update host attribute '%s' for host '%s'.\n", + "store/update host attribute '%s' for host '%s'.", attr.attr_name, attr.hostname); free(attr.hostname); free(attr.attr_name); @@ -132,12 +132,12 @@ sdb_puppet_stcfg_init(sdb_object_t *user_data) client = SDB_OBJ_WRAPPER(user_data)->data; if (sdb_dbi_client_connect(client)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Failed to connect to the storeconfigs DB.\n"); + "Failed to connect to the storeconfigs DB."); return -1; } sdb_log(SDB_LOG_INFO, "puppet::store-configs backend: Successfully " - "connected to the storeconfigs DB.\n"); + "connected to the storeconfigs DB."); return 0; } /* sdb_puppet_stcfg_init */ @@ -152,7 +152,7 @@ sdb_puppet_stcfg_collect(sdb_object_t *user_data) client = SDB_OBJ_WRAPPER(user_data)->data; if (sdb_dbi_client_check_conn(client)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Connection to storeconfigs DB failed.\n"); + "Connection to storeconfigs DB failed."); return -1; } @@ -160,7 +160,7 @@ sdb_puppet_stcfg_collect(sdb_object_t *user_data) sdb_puppet_stcfg_get_hosts, NULL, /* #columns = */ 2, /* col types = */ SDB_TYPE_STRING, SDB_TYPE_DATETIME)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Failed to " - "retrieve hosts from the storeconfigs DB.\n"); + "retrieve hosts from the storeconfigs DB."); return -1; } @@ -178,7 +178,7 @@ sdb_puppet_stcfg_collect(sdb_object_t *user_data) /* col types = */ SDB_TYPE_STRING, SDB_TYPE_STRING, SDB_TYPE_STRING, SDB_TYPE_DATETIME)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Failed to " - "retrieve host attributes from the storeconfigs DB.\n"); + "retrieve host attributes from the storeconfigs DB."); return -1; } return 0; @@ -202,7 +202,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (oconfig_get_string(ci, &name)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Connection " "requires a single string argument\n" - "\tUsage: \n"); + "\tUsage: "); return -1; } @@ -216,7 +216,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (oconfig_get_string(child, &driver)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " "DBAdapter requires a single string argument inside " - "\n\tUsage: DBAdapter NAME\n", + "\n\tUsage: DBAdapter NAME", name); } continue; @@ -225,7 +225,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (oconfig_get_string(child, &database)) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " "DBName requires a single string argument inside " - "\n\tUsage: DBName NAME\n", + "\n\tUsage: DBName NAME", name); } continue; @@ -253,7 +253,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " "DBIOption requires exactly two string arguments " "inside \n" - "\tUsage: DBIOption KEY VALUE\n", name); + "\tUsage: DBIOption KEY VALUE", name); continue; } @@ -264,14 +264,14 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) else { sdb_log(SDB_LOG_WARNING, "puppet::store-configs backend: " "Ignoring unknown config option '%s' inside " - ".\n", child->key, name); + ".", child->key, name); continue; } if (status) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: Option " "'%s' requires a single string argument inside " - "\n\tUsage: DBAdapter NAME\n", + "\n\tUsage: DBAdapter NAME", child->key, name); continue; } @@ -282,7 +282,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (! (options = sdb_dbi_options_create())) { char errmsg[1024]; sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Failed to create DBI options object: %s\n", + "Failed to create DBI options object: %s", sdb_strerror(errno, errmsg, sizeof(errmsg))); continue; } @@ -291,7 +291,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (sdb_dbi_options_add(options, key, value)) { char errmsg[1024]; sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Failed to add option '%s': %s\n", key, + "Failed to add option '%s': %s", key, sdb_strerror(errno, errmsg, sizeof(errmsg))); continue; } @@ -299,13 +299,13 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (! driver) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Connection '%s' " "missing the 'DBAdapter' option.\n", + "Connection '%s' " "missing the 'DBAdapter' option.", name); return -1; } if (! database) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Connection '%s' missing the 'DBName' option.\n", name); + "Connection '%s' missing the 'DBName' option.", name); return -1; } @@ -316,7 +316,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (! client) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Failed to create DBI client: %s\n", + "Failed to create DBI client: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -328,7 +328,7 @@ sdb_puppet_stcfg_config_conn(oconfig_item_t *ci) if (! user_data) { sdb_dbi_client_destroy(client); sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: " - "Failed to allocate sdb_object_t\n"); + "Failed to allocate sdb_object_t"); return -1; } @@ -353,7 +353,7 @@ sdb_puppet_stcfg_config(oconfig_item_t *ci) sdb_puppet_stcfg_config_conn(child); else sdb_log(SDB_LOG_WARNING, "puppet::store-configs backend: " - "Ignoring unknown config option '%s'.\n", child->key); + "Ignoring unknown config option '%s'.", child->key); } return 0; } /* sdb_puppet_stcfg_config */ @@ -373,7 +373,7 @@ sdb_module_init(sdb_plugin_info_t *info) if (dbi_initialize(/* driver dir = */ NULL) < 0) { sdb_log(SDB_LOG_ERR, "puppet::store-configs backend: failed to " "initialize DBI; possibly you don't have any drivers " - "installed.\n"); + "installed."); return -1; } diff --git a/src/core/plugin.c b/src/core/plugin.c index c8e8e9e..7a8483f 100644 --- a/src/core/plugin.c +++ b/src/core/plugin.c @@ -200,7 +200,7 @@ sdb_plugin_cb_init(sdb_object_t *obj, va_list ap) if (sdb_plugin_find_by_name(*list, name)) { sdb_log(SDB_LOG_WARNING, "plugin: %s callback '%s' " "has already been registered. Ignoring newly " - "registered version.\n", type, name); + "registered version.", type, name); return -1; } @@ -252,7 +252,7 @@ sdb_plugin_add_callback(sdb_llist_t **list, const char *type, /* pass control to the list */ sdb_object_deref(obj); - sdb_log(SDB_LOG_INFO, "plugin: Registered %s callback '%s'.\n", + sdb_log(SDB_LOG_INFO, "plugin: Registered %s callback '%s'.", type, name); return 0; } /* sdb_plugin_add_callback */ @@ -296,7 +296,7 @@ sdb_plugin_load(const char *name) if (access(filename, R_OK)) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "plugin: Failed to load plugin '%s' (%s): %s\n", + sdb_log(SDB_LOG_ERR, "plugin: Failed to load plugin '%s' (%s): %s", name, filename, sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -306,7 +306,7 @@ sdb_plugin_load(const char *name) lh = lt_dlopen(filename); if (! lh) { - sdb_log(SDB_LOG_ERR, "plugin: Failed to load plugin '%s': %s\n" + sdb_log(SDB_LOG_ERR, "plugin: Failed to load plugin '%s': %s" "The most common cause for this problem are missing " "dependencies.\n", name, lt_dlerror()); return -1; @@ -315,14 +315,14 @@ sdb_plugin_load(const char *name) mod_init = (int (*)(sdb_plugin_info_t *))lt_dlsym(lh, "sdb_module_init"); if (! mod_init) { sdb_log(SDB_LOG_ERR, "plugin: Failed to load plugin '%s': " - "could not find symbol 'sdb_module_init'\n", name); + "could not find symbol 'sdb_module_init'", name); return -1; } status = mod_init(&plugin_info); if (status) { sdb_log(SDB_LOG_ERR, "plugin: Failed to initialize " - "plugin '%s'\n", name); + "plugin '%s'", name); return -1; } @@ -331,12 +331,12 @@ sdb_plugin_load(const char *name) || ((int)(plugin_info.version / 100) != (int)(SDB_VERSION / 100))) sdb_log(SDB_LOG_WARNING, "plugin: WARNING: version of " "plugin '%s' (%i.%i.%i) does not match our version " - "(%i.%i.%i); this might cause problems\n", + "(%i.%i.%i); this might cause problems", name, SDB_VERSION_DECODE(plugin_info.version), SDB_VERSION_DECODE(SDB_VERSION)); sdb_log(SDB_LOG_INFO, "plugin: Successfully loaded " - "plugin '%s' v%i (%s)\n\t%s\n", + "plugin '%s' v%i (%s)\n\t%s", plugin_info.name, plugin_info.plugin_version, plugin_info.description, plugin_info.copyright); return 0; @@ -455,7 +455,7 @@ sdb_plugin_register_collector(const char *name, sdb_plugin_collector_cb callback if (! (SDB_PLUGIN_CCB(obj)->ccb_next_update = sdb_gettime())) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "plugin: Failed to determine current " - "time: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "time: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); sdb_object_deref(obj); return -1; } @@ -470,7 +470,7 @@ sdb_plugin_register_collector(const char *name, sdb_plugin_collector_cb callback sdb_object_deref(obj); sdb_log(SDB_LOG_INFO, "plugin: Registered collector callback '%s' " - "(interval = %.3fs).\n", name, + "(interval = %.3fs).", name, SDB_TIME_TO_DOUBLE(SDB_PLUGIN_CCB(obj)->ccb_interval)); return 0; } /* sdb_plugin_register_collector */ @@ -528,7 +528,7 @@ sdb_plugin_configure(const char *name, oconfig_item_t *ci) if (! plugin) { /* XXX: check if any such plugin has been loaded */ sdb_log(SDB_LOG_ERR, "plugin: Plugin '%s' did not register " - "a config callback.\n", name); + "a config callback.", name); errno = ENOENT; return -1; } @@ -585,7 +585,7 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) if (! (now = sdb_gettime())) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "plugin: Failed to determine current " - "time: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "time: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); now = SDB_PLUGIN_CCB(obj)->ccb_next_update; } @@ -596,7 +596,7 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) while (loop->do_loop && sdb_sleep(interval, &interval)) { if (errno != EINTR) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "plugin: Failed to sleep: %s\n", + sdb_log(SDB_LOG_ERR, "plugin: Failed to sleep: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -619,7 +619,7 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) if (! interval) { sdb_log(SDB_LOG_WARNING, "plugin: No interval configured " "for plugin '%s'; skipping any further " - "iterations.\n", SDB_PLUGIN_CCB(obj)->ccb_name); + "iterations.", SDB_PLUGIN_CCB(obj)->ccb_name); sdb_object_deref(obj); continue; } @@ -629,13 +629,13 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) if (! (now = sdb_gettime())) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "plugin: Failed to determine current " - "time: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "time: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); now = SDB_PLUGIN_CCB(obj)->ccb_next_update; } if (now > SDB_PLUGIN_CCB(obj)->ccb_next_update) { sdb_log(SDB_LOG_WARNING, "plugin: Plugin '%s' took too " - "long; skipping iterations to keep up.\n", + "long; skipping iterations to keep up.", SDB_PLUGIN_CCB(obj)->ccb_name); SDB_PLUGIN_CCB(obj)->ccb_next_update = now; } @@ -644,7 +644,7 @@ sdb_plugin_collector_loop(sdb_plugin_loop_t *loop) sdb_plugin_cmp_next_update)) { sdb_log(SDB_LOG_ERR, "plugin: Failed to re-insert " "plugin '%s' into collector list. Unable to further " - "use the plugin.\n", + "use the plugin.", SDB_PLUGIN_CCB(obj)->ccb_name); sdb_object_deref(obj); return -1; diff --git a/src/core/store.c b/src/core/store.c index 0496810..cd53922 100644 --- a/src/core/store.c +++ b/src/core/store.c @@ -258,7 +258,7 @@ sdb_store_host(const sdb_host_t *host) if (old) { if (old->host_last_update > last_update) { sdb_log(SDB_LOG_DEBUG, "store: Cannot update host '%s' - " - "value too old (%"PRIscTIME" < %"PRIscTIME")\n", + "value too old (%"PRIscTIME" < %"PRIscTIME")", host->host_name, last_update, old->host_last_update); /* don't report an error; the host may be updated by multiple * backends */ @@ -272,8 +272,8 @@ sdb_store_host(const sdb_host_t *host) sdb_host_t *new = sdb_host_clone(host); if (! new) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "store: Failed to clone host object: " - "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + sdb_log(SDB_LOG_ERR, "store: Failed to clone host object: %s", + sdb_strerror(errno, errbuf, sizeof(errbuf))); pthread_rwlock_unlock(&host_lock); return -1; } @@ -282,7 +282,7 @@ sdb_store_host(const sdb_host_t *host) if (! (new->attributes = sdb_llist_create())) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "store: Failed to initialize " - "host object '%s': %s\n", host->host_name, + "host object '%s': %s", host->host_name, sdb_strerror(errno, errbuf, sizeof(errbuf))); sdb_object_deref(SDB_OBJ(new)); pthread_rwlock_unlock(&host_lock); @@ -294,7 +294,7 @@ sdb_store_host(const sdb_host_t *host) if (! (new->services = sdb_llist_create())) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "store: Failed to initialize " - "host object '%s': %s\n", host->host_name, + "host object '%s': %s", host->host_name, sdb_strerror(errno, errbuf, sizeof(errbuf))); sdb_object_deref(SDB_OBJ(new)); pthread_rwlock_unlock(&host_lock); @@ -402,7 +402,7 @@ sdb_store_attribute(const sdb_attribute_t *attr) if (old) { if (old->host_last_update > last_update) { sdb_log(SDB_LOG_DEBUG, "store: Cannot update attribute " - "'%s/%s' - value too old (%"PRIscTIME" < %"PRIscTIME")\n", + "'%s/%s' - value too old (%"PRIscTIME" < %"PRIscTIME")", attr->hostname, attr->attr_name, last_update, old->host_last_update); status = 1; @@ -416,7 +416,7 @@ sdb_store_attribute(const sdb_attribute_t *attr) if (! new) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "store: Failed to clone attribute " - "object: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "object: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); pthread_rwlock_unlock(&host_lock); return -1; } @@ -500,7 +500,7 @@ sdb_store_service(const sdb_service_t *svc) if (old) { if (old->host_last_update > last_update) { sdb_log(SDB_LOG_DEBUG, "store: Cannot update service " - "'%s/%s' - value too old (%"PRIscTIME" < %"PRIscTIME")\n", + "'%s/%s' - value too old (%"PRIscTIME" < %"PRIscTIME")", svc->hostname, svc->svc_name, last_update, old->host_last_update); status = 1; @@ -514,7 +514,7 @@ sdb_store_service(const sdb_service_t *svc) if (! new) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "store: Failed to clone service " - "object: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "object: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); pthread_rwlock_unlock(&host_lock); return -1; } diff --git a/src/daemon/config.c b/src/daemon/config.c index 95e45e3..bb80d3b 100644 --- a/src/daemon/config.c +++ b/src/daemon/config.c @@ -58,13 +58,13 @@ config_get_interval(oconfig_item_t *ci, sdb_time_t *interval) if (oconfig_get_number(ci, &interval_dbl)) { sdb_log(SDB_LOG_ERR, "config: Interval requires " "a single numeric argument\n" - "\tUsage: Interval SECONDS\n"); + "\tUsage: Interval SECONDS"); return -1; } if (interval_dbl <= 0.0) { sdb_log(SDB_LOG_ERR, "config: Invalid interval: %f\n" - "\tInterval may not be less than or equal to zero.\n", + "\tInterval may not be less than or equal to zero.", interval_dbl); return -1; } @@ -104,7 +104,7 @@ daemon_load_backend(oconfig_item_t *ci) if (oconfig_get_string(ci, &name)) { sdb_log(SDB_LOG_ERR, "config: LoadBackend requires a single " "string argument\n" - "\tUsage: LoadBackend BACKEND\n"); + "\tUsage: LoadBackend BACKEND"); return -1; } @@ -120,7 +120,7 @@ daemon_load_backend(oconfig_item_t *ci) else { sdb_log(SDB_LOG_WARNING, "config: Unknown option '%s' " "inside 'LoadBackend' -- see the documentation for " - "details.\n", child->key); + "details.", child->key); continue; } } @@ -141,7 +141,7 @@ daemon_configure_plugin(oconfig_item_t *ci) if (oconfig_get_string(ci, &name)) { sdb_log(SDB_LOG_ERR, "config: %s requires a single " "string argument\n" - "\tUsage: LoadBackend BACKEND\n", + "\tUsage: LoadBackend BACKEND", ci->key); return -1; } diff --git a/src/daemon/sysdbd.c b/src/daemon/sysdbd.c index fa31490..e977c2f 100644 --- a/src/daemon/sysdbd.c +++ b/src/daemon/sysdbd.c @@ -108,7 +108,7 @@ daemonize(void) if ((pid = fork()) < 0) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "Failed to fork to background: %s\n", + sdb_log(SDB_LOG_ERR, "Failed to fork to background: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return errno; } @@ -120,7 +120,7 @@ daemonize(void) if (chdir("/")) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "Failed to change working directory to " - "the root directory: %s\n", + "the root directory: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return errno; } @@ -131,24 +131,24 @@ daemonize(void) close(0); if (open("/dev/null", O_RDWR)) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "Failed to connect stdin to '/dev/null': " - "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + sdb_log(SDB_LOG_ERR, "Failed to connect stdin to '/dev/null': %s", + sdb_strerror(errno, errbuf, sizeof(errbuf))); return errno; } close(1); if (dup(0) != 1) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "Could not connect stdout to '/dev/null': " - "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + sdb_log(SDB_LOG_ERR, "Could not connect stdout to '/dev/null': %s", + sdb_strerror(errno, errbuf, sizeof(errbuf))); return errno; } close(2); if (dup(0) != 2) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "Could not connect stderr to '/dev/null': " - "%s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + sdb_log(SDB_LOG_ERR, "Could not connect stderr to '/dev/null': %s", + sdb_strerror(errno, errbuf, sizeof(errbuf))); return errno; } return 0; @@ -194,7 +194,7 @@ main(int argc, char **argv) config_filename = CONFIGFILE; if (daemon_parse_config(config_filename)) { - sdb_log(SDB_LOG_ERR, "Failed to parse configuration file.\n"); + sdb_log(SDB_LOG_ERR, "Failed to parse configuration file."); exit(1); } @@ -205,13 +205,13 @@ main(int argc, char **argv) if (sigaction(SIGINT, &sa_intterm, /* old action */ NULL)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "Failed to install signal handler for " - "SIGINT: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "SIGINT: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); exit(1); } if (sigaction(SIGTERM, &sa_intterm, /* old action */ NULL)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "Failed to install signal handler for " - "SIGTERM: %s\n", sdb_strerror(errno, errbuf, sizeof(errbuf))); + "SIGTERM: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); exit(1); } @@ -220,14 +220,14 @@ main(int argc, char **argv) exit(1); sdb_log(SDB_LOG_INFO, "SysDB daemon "SDB_VERSION_STRING - SDB_VERSION_EXTRA " (pid %i) initialized successfully\n", + SDB_VERSION_EXTRA " (pid %i) initialized successfully", (int)getpid()); sdb_plugin_init_all(); sdb_plugin_collector_loop(&plugin_main_loop); sdb_log(SDB_LOG_INFO, "Shutting down SysDB daemon "SDB_VERSION_STRING - SDB_VERSION_EXTRA" (pid %i)\n", (int)getpid()); + SDB_VERSION_EXTRA" (pid %i)", (int)getpid()); fprintf(stderr, "Store dump:\n"); sdb_store_dump(stderr); diff --git a/src/utils/dbi.c b/src/utils/dbi.c index 60b47c4..5188058 100644 --- a/src/utils/dbi.c +++ b/src/utils/dbi.c @@ -103,7 +103,7 @@ sdb_dbi_get_field(dbi_result res, unsigned int i, break; default: sdb_log(SDB_LOG_ERR, "dbi: Unexpected type %i while " - "parsing query result.\n", type); + "parsing query result.", type); return -1; } @@ -129,7 +129,7 @@ sdb_dbi_get_data(sdb_dbi_client_t *client, dbi_result res, for (i = 0; i < num_fields; ++i) { types[i] = dbi_result_get_field_type_idx(res, i + 1); if (types[i] == DBI_TYPE_ERROR) { - sdb_log(SDB_LOG_ERR, "dbi: failed to fetch data: %s\n", + sdb_log(SDB_LOG_ERR, "dbi: failed to fetch data: %s", sdb_dbi_strerror(client->conn)); return -1; } @@ -142,8 +142,8 @@ sdb_dbi_get_data(sdb_dbi_client_t *client, dbi_result res, for (n = 0; n < num_rows; ++n) { if (! dbi_result_seek_row(res, n + 1)) { - sdb_log(SDB_LOG_ERR, "dbi: Failed to retrieve row %llu: " - "%s\n", n, sdb_dbi_strerror(client->conn)); + sdb_log(SDB_LOG_ERR, "dbi: Failed to retrieve row %llu: %s", + n, sdb_dbi_strerror(client->conn)); continue; } @@ -305,7 +305,7 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client) client->conn = dbi_conn_open(driver); if (! client->conn) { sdb_log(SDB_LOG_ERR, "dbi: failed to open connection " - "object.\n"); + "object."); return -1; } @@ -319,8 +319,8 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client) continue; /* else: error */ - sdb_error_set("dbi: failed to set option '%s': " - "%s\n", client->options->options[i].key, + sdb_error_set("dbi: failed to set option '%s': %s\n", + client->options->options[i].key, sdb_dbi_strerror(client->conn)); sdb_error_append("dbi: known driver options:\n"); @@ -335,15 +335,15 @@ sdb_dbi_client_connect(sdb_dbi_client_t *client) } if (dbi_conn_set_option(client->conn, "dbname", client->database)) { - sdb_log(SDB_LOG_ERR, "dbi: failed to set option 'dbname': %s\n", + sdb_log(SDB_LOG_ERR, "dbi: failed to set option 'dbname': %s", sdb_dbi_strerror(client->conn)); dbi_conn_close(client->conn); return -1; } if (dbi_conn_connect(client->conn) < 0) { - sdb_log(SDB_LOG_ERR, "dbi: failed to connect to database '%s': " - "%s\n", client->database, sdb_dbi_strerror(client->conn)); + sdb_log(SDB_LOG_ERR, "dbi: failed to connect to database '%s': %s", + client->database, sdb_dbi_strerror(client->conn)); dbi_conn_close(client->conn); return -1; } @@ -378,14 +378,14 @@ sdb_dbi_exec_query(sdb_dbi_client_t *client, const char *query, res = dbi_conn_query(client->conn, query); if (! res) { - sdb_log(SDB_LOG_ERR, "dbi: failed to execute query '%s': %s\n", + sdb_log(SDB_LOG_ERR, "dbi: failed to execute query '%s': %s", query, sdb_dbi_strerror(client->conn)); return -1; } if (dbi_result_get_numrows(res) == DBI_ROW_ERROR) { sdb_log(SDB_LOG_ERR, "dbi: failed to fetch rows for query " - "'%s': %s\n", query, sdb_dbi_strerror(client->conn)); + "'%s': %s", query, sdb_dbi_strerror(client->conn)); dbi_result_free(res); return -1; } @@ -404,7 +404,7 @@ sdb_dbi_exec_query(sdb_dbi_client_t *client, const char *query, if (n != (int)num_fields) { sdb_log(SDB_LOG_ERR, "dbi: number of returned fields (%i) " "does not match the number of requested fields (%i) " - "for query '%s'.\n", num_fields, n, query); + "for query '%s'.", num_fields, n, query); dbi_result_free(res); return -1; } @@ -423,7 +423,7 @@ sdb_dbi_exec_query(sdb_dbi_client_t *client, const char *query, /* column count starts at 1 */ if ((unsigned int)field_type != type) { sdb_log(SDB_LOG_ERR, "dbi: type of column '%s' (%u) " - "does not match requested type (%u).\n", + "does not match requested type (%u).", dbi_result_get_field_name(res, (unsigned int)i + 1), field_type, type); status = -1; diff --git a/src/utils/unixsock.c b/src/utils/unixsock.c index bc9806c..8c0abb2 100644 --- a/src/utils/unixsock.c +++ b/src/utils/unixsock.c @@ -117,7 +117,7 @@ sdb_unixsock_parse_cell(char *string, int type, sdb_data_t *data) break; default: sdb_log(SDB_LOG_ERR, "unixsock: Unexpected type %i while " - "parsing query result.\n", type); + "parsing query result.", type); return -1; } @@ -126,13 +126,13 @@ sdb_unixsock_parse_cell(char *string, int type, sdb_data_t *data) if (errno || (string == endptr)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "unixsock: Failed to parse string " - "'%s' as numeric value (type %i): %s\n", string, type, + "'%s' as numeric value (type %i): %s", string, type, sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } else if (endptr && (*endptr != '\0')) sdb_log(SDB_LOG_WARNING, "unixsock: Ignoring garbage after " - "number while parsing numeric value (type %i): %s.\n", + "number while parsing numeric value (type %i): %s.", type, endptr); } @@ -159,7 +159,7 @@ sdb_unixsock_client_process_one_line(sdb_unixsock_client_t *client, if (! line) { /* this must no happen */ sdb_log(SDB_LOG_ERR, "unixsock: Unexpected EOL while " "parsing line (expected %i columns delimited by '%s'; " - "got %i): %s\n", column_count, delim, + "got %i): %s", column_count, delim, /* last line number */ i, orig_line); return -1; } @@ -231,7 +231,7 @@ sdb_unixsock_client_connect(sdb_unixsock_client_t *client) fd = socket(AF_UNIX, SOCK_STREAM, /* protocol = */ 0); if (fd < 0) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "unixsock: Failed to open socket: %s\n", + sdb_log(SDB_LOG_ERR, "unixsock: Failed to open socket: %s", sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; } @@ -242,7 +242,7 @@ sdb_unixsock_client_connect(sdb_unixsock_client_t *client) if (connect(fd, (struct sockaddr *)&sa, sizeof(sa))) { char errbuf[1024]; - sdb_log(SDB_LOG_ERR, "unixsock: Failed to connect to %s: %s\n", + sdb_log(SDB_LOG_ERR, "unixsock: Failed to connect to %s: %s", sa.sun_path, sdb_strerror(errno, errbuf, sizeof(errbuf))); close(fd); return -1; @@ -252,7 +252,7 @@ sdb_unixsock_client_connect(sdb_unixsock_client_t *client) if (! client->fh) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "unixsock: Failed to open I/O " - "stream for %s: %s\n", sa.sun_path, + "stream for %s: %s", sa.sun_path, sdb_strerror(errno, errbuf, sizeof(errbuf))); close(fd); return -1; @@ -278,7 +278,7 @@ sdb_unixsock_client_send(sdb_unixsock_client_t *client, if (status < 0) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "unixsock: Failed to write to " - "socket (%s): %s\n", client->path, + "socket (%s): %s", client->path, sdb_strerror(errno, errbuf, sizeof(errbuf))); return status; } @@ -300,7 +300,7 @@ sdb_unixsock_client_recv(sdb_unixsock_client_t *client, if (! feof(client->fh)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "unixsock: Failed to read " - "from socket (%s): %s\n", client->path, + "from socket (%s): %s", client->path, sdb_strerror(errno, errbuf, sizeof(errbuf))); } return buffer; @@ -342,7 +342,7 @@ sdb_unixsock_client_process_lines(sdb_unixsock_client_t *client, if ((types[i] < 1) || (types[i] > SDB_TYPE_BINARY)) { sdb_log(SDB_LOG_ERR, "unixsock: Unknown column " "type %i while processing response from the " - "UNIX socket @ %s.\n", types[i], client->path); + "UNIX socket @ %s.", types[i], client->path); va_end(ap); free(types); return -1; @@ -375,8 +375,8 @@ sdb_unixsock_client_process_lines(sdb_unixsock_client_t *client, if ((n_cols >= 0) && (n_cols != column_count)) { sdb_log(SDB_LOG_ERR, "unixsock: number of columns (%i) " "does not match the number of requested columns (%i) " - "while processing response from the UNIX socket @ %s: " - "%s\n", column_count, n_cols, client->path, line); + "while processing response from the UNIX socket @ %s: %s", + column_count, n_cols, client->path, line); continue; } @@ -395,7 +395,7 @@ sdb_unixsock_client_process_lines(sdb_unixsock_client_t *client, || sdb_unixsock_client_error(client)) { char errbuf[1024]; sdb_log(SDB_LOG_ERR, "unixsock: Unexpected end of data while " - "reading from socket (%s): %s\n", client->path, + "reading from socket (%s): %s", client->path, sdb_strerror(errno, errbuf, sizeof(errbuf))); return -1; }