From mboxrd@z Thu Jan 1 00:00:00 1970 From: NAHieu Subject: [PATCH] check for access type in xs.c Date: Fri, 9 Sep 2005 01:50:03 +0900 Message-ID: <5d7aca9505090809501cea754f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Some library functions in xs.c don't support /proc/xen/xenbus interface (yet). Here is the patch to fix the problem. diff -r c2705e74efba tools/xenstore/xs.c --- a/tools/xenstore/xs.c Thu Sep 8 15:22:01 2005 +++ b/tools/xenstore/xs.c Fri Sep 9 01:48:38 2005 @@ -508,6 +508,9 @@ struct xsd_sockmsg msg; char **ret; =20 + if (h->type =3D=3D DEV) + return NULL; /* support only with socket interface */=20 + if (!read_all(h->fd, &msg, sizeof(msg))) return NULL; =20 @@ -624,6 +627,8 @@ =20 bool xs_shutdown(struct xs_handle *h) { + if (h->type =3D=3D DEV) + return false; /* support only with socket interface */=20 bool ret =3D xs_bool(xs_single(h, XS_SHUTDOWN, "", NULL)); if (ret) { char c;