Don't abort on untranslatable errors: EINVAL and print warning

Signed-off-by: Rusty Russel <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
This commit is contained in:
cl349@firebug.cl.cam.ac.uk committed 2005-08-02 17:59:20 +00:00
1 parent d16ff05a08
commit c5a8d2c78b
1 file changed
+7 -5
+7 -5
View File
@@ -504,11 +504,13 @@ void send_error(struct connection *conn, int error)
{
unsigned int i;
for (i = 0; error != xsd_errors[i].errnum; i++)
if (i == ARRAY_SIZE(xsd_errors) - 1)
corrupt(conn, "Unknown error %i (%s)", error,
strerror(error));
for (i = 0; error != xsd_errors[i].errnum; i++) {
if (i == ARRAY_SIZE(xsd_errors) - 1) {
eprintf("xenstored: error %i untranslatable", error);
i = 0; /* EINVAL */
break;
}
}
send_reply(conn, XS_ERROR, xsd_errors[i].errstring,
strlen(xsd_errors[i].errstring) + 1);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.