diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-11-16 00:42:34 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2012-11-16 00:42:34 +0100 |
commit | 23c4ef67c735813fd41f66f6722b996d1ad7314a (patch) | |
tree | add54d965c816cb57d8c08ef172c7a61b007b03b /lib | |
parent | 235aa7ff17e12ca7a76dcfd77abfe143c2ce4dea (diff) | |
download | libnl-23c4ef67c735813fd41f66f6722b996d1ad7314a.tar.gz |
Use NL_DBG() instead of printing warnings and errors to stderr
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/attr.c | 4 | ||||
-rw-r--r-- | lib/cache.c | 2 | ||||
-rw-r--r-- | lib/cache_mngt.c | 8 | ||||
-rw-r--r-- | lib/route/classid.c | 2 | ||||
-rw-r--r-- | lib/utils.c | 2 |
5 files changed, 9 insertions, 9 deletions
@@ -253,7 +253,7 @@ int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, int type = nla_type(nla); if (type == 0) { - fprintf(stderr, "Illegal nla->nla_type == 0\n"); + NL_DBG(1, "Illegal nla->nla_type == 0\n"); continue; } @@ -269,7 +269,7 @@ int nla_parse(struct nlattr *tb[], int maxtype, struct nlattr *head, int len, } if (rem > 0) - fprintf(stderr, "netlink: %d bytes leftover after parsing " + NL_DBG(1, "netlink: %d bytes leftover after parsing " "attributes.\n", rem); err = 0; diff --git a/lib/cache.c b/lib/cache.c index 36566e0..aa17ad8 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -925,7 +925,7 @@ restart: err = nl_cache_pickup(sk, cache); if (err == -NLE_DUMP_INTR) { - fprintf(stderr, "dump interrupted, restarting!\n"); + NL_DBG(1, "dump interrupted, restarting!\n"); goto restart; } else if (err < 0) break; diff --git a/lib/cache_mngt.c b/lib/cache_mngt.c index 8f011fb..914ab9b 100644 --- a/lib/cache_mngt.c +++ b/lib/cache_mngt.c @@ -404,10 +404,10 @@ struct nl_cache *nl_cache_mngt_require(const char *name) struct nl_cache *cache; if (!(cache = __nl_cache_mngt_require(name))) - fprintf(stderr, "Application BUG: Your application must " - "call nl_cache_mngt_provide() and\nprovide a valid " - "%s cache to be used for internal lookups.\nSee the " - " API documentation for more details.\n", name); + NL_DBG(1, "Application BUG: Your application must " + "call nl_cache_mngt_provide() and\nprovide a valid " + "%s cache to be used for internal lookups.\nSee the " + " API documentation for more details.\n", name); return cache; } diff --git a/lib/route/classid.c b/lib/route/classid.c index 87025a0..255e075 100644 --- a/lib/route/classid.c +++ b/lib/route/classid.c @@ -441,7 +441,7 @@ static void __init classid_init(void) nl_init_list_head(&tbl_name[i]); if ((err = rtnl_tc_read_classid_file()) < 0) - fprintf(stderr, "Failed to read classid file: %s\n", nl_geterror(err)); + NL_DBG(1, "Failed to read classid file: %s\n", nl_geterror(err)); } static void free_map(void *map) { diff --git a/lib/utils.c b/lib/utils.c index b5e32c3..b434bee 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -426,7 +426,7 @@ static void __init get_psched_settings(void) if (fscanf(fd, "%08x %08x %08x %08x", &ns_per_usec, &ns_per_tick, &nom, &denom) != 4) { - fprintf(stderr, "Fatal error: can not read psched settings from \"%s\". " \ + NL_DBG(1, "Fatal error: can not read psched settings from \"%s\". " \ "Try to set TICKS_PER_USEC, PROC_NET_PSCHED or PROC_ROOT " \ "environment variables\n", name); exit(1); |