diff -r 99263132665b tools/xenstore/xenstored_domain.c --- a/tools/xenstore/xenstored_domain.c Fri May 18 12:38:55 2012 +0200 +++ b/tools/xenstore/xenstored_domain.c Tue May 22 17:25:03 2012 +0200 @@ -167,7 +167,7 @@ static int readchn(struct connection *co static void *map_interface(domid_t domid, unsigned long mfn) { - if (*xcg_handle >= 0) { + if (*xcg_handle != NULL) { /* this is the preferred method */ return xc_gnttab_map_grant_ref(*xcg_handle, domid, GNTTAB_RESERVED_XENSTORE, PROT_READ|PROT_WRITE); @@ -179,7 +179,7 @@ static void *map_interface(domid_t domid static void unmap_interface(void *interface) { - if (*xcg_handle >= 0) + if (*xcg_handle != NULL) xc_gnttab_munmap(*xcg_handle, interface, 1); else munmap(interface, getpagesize());