Blob Blame History Raw
diff -rup xen-3.1.0-testing.hg-rc7.orig/tools/xenfb/xenfb.c xen-3.1.0-testing.hg-rc7.new/tools/xenfb/xenfb.c
--- xen-3.1.0-testing.hg-rc7.orig/tools/xenfb/xenfb.c	2007-05-17 17:38:22.000000000 -0400
+++ xen-3.1.0-testing.hg-rc7.new/tools/xenfb/xenfb.c	2007-05-17 18:33:25.000000000 -0400
@@ -318,6 +318,10 @@ static int xenfb_using_old_protocol(stru
 
 	for (;;) {
 		state = xenfb_read_state(xsh, xenfb->fb.otherend);
+		if (state == XenbusStateUnknown) {
+			ret = -1;
+			break;
+		}
 		if (state > XenbusStateInitialising) {
 			ret = 0; /* frontend talks xenbus protocol */
 			break;
@@ -570,7 +574,7 @@ int xenfb_attach_dom(struct xenfb *xenfb
 {
 	struct xenfb_private *xenfb = (struct xenfb_private *)xenfb_pub;
 	struct xs_handle *xsh = xenfb->xsh;
-	int val, serrno;
+	int ret, val, serrno;
 	struct xenfb_page *fb_page;
 
 	xenfb_detach_dom(xenfb);
@@ -600,8 +604,9 @@ int xenfb_attach_dom(struct xenfb *xenfb
 	if (!xs_watch(xsh, xenfb->kbd.otherend, ""))
 		goto error;
 
-	if (xenfb_using_old_protocol(xenfb))
-		return 1;
+	ret = xenfb_using_old_protocol(xenfb);
+	if (ret)
+		return ret;
 
 	if (xenfb_wait_for_frontend_initialised(&xenfb->fb) < 0)
 		goto error;