提交 1dc25872 编写于 作者: M Michal Privoznik

virHashAddEntry: Report error on duplicate key

If this function fails, the error message is reported only in
some cases (e.g. OOM), but in some it's not (e.g. duplicate key).
This fact is painful and we should either not report error at all
or report the error in all possible cases. I vote for the latter.
Unfortunately, since the key may be an arbitrary value (not
necessarily a string) we can't report it in the error message.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 890676d2
......@@ -353,6 +353,8 @@ virHashAddOrUpdateEntry(virHashTablePtr table, const void *name,
entry->payload = userdata;
return 0;
} else {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Duplicate key"));
return -1;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册