Skip to contentSkip to conversation

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

PATCH New Rusty Russell 1 participant 1 message Aug 4, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 8/11 Don't abort on untranslatable errors: EINVAL and print warning.

# HG changeset patch
# User Rusty Russell <[email protected]>
# Node ID 24d23956f7da1dfe80773ced552041cf953c090a
# Parent 3550a20343ba6762cfca9e43d38866b036363e32 Don't abort on untranslatable errors: EINVAL and print warning. (Test was useful in development, bad for deployment).

tools/xenstore/xenstored_core.c +7 -5
diff -r 3550a20343ba -r 24d23956f7da tools/xenstore/xenstored_core.c
@@ -504,11 +504,13 @@
 {
 	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);
 }