commit 5e923cc8a0e91c6fee9ce4e17b340016d80f7c64
Author: Jim Meyering <meyering(a)redhat.com>
Date: Mon Jun 6 19:12:12 2011 +0200
avoid more useless diagnostics: "failed to get policy..."
* meta.cpp (GetValue): In the common case, return ENOENT, rather
than ENXIO ("no such device or address"), to distinguish from
another use of ENXIO. So we can...
* rest.c (recheck_replication): ...suppress a useless diagnostic.
Most replication checks would evoke a message like this:
"iwhd: failed to get policy for b-39/obj: No such device or address"
There was no error there. Just absence of policy. We shouldn't
be polluting logs with non-errors like that.
meta.cpp | 2 +-
rest.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/meta.cpp b/meta.cpp
index b88b8c3..a699863 100644
--- a/meta.cpp
+++ b/meta.cpp
@@ -370,7 +370,7 @@ RepoMeta::GetValue (const char *bucket, const char *key, const char
*mkey,
bo = curs->next();
data = bo.getStringField(mkey);
if (!data || !*data) {
- return ENXIO;
+ return ENOENT;
}
*mvalue = strdup(data);
diff --git a/rest.c b/rest.c
index d3d8617..9c39673 100644
--- a/rest.c
+++ b/rest.c
@@ -380,7 +380,7 @@ recheck_replication (my_state *ms, char *policy)
if (!policy) {
DPRINTF("fetching policy for %s/%s\n",ms->bucket,ms->key);
int rc = meta_get_value(ms->bucket,ms->key, "_policy", &policy);
- if (rc)
+ if (rc && rc != ENOENT)
error (0, rc, _("failed to get policy for %s/%s"),
ms->bucket,ms->key);
}
Show replies by date