From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Wolf Subject: [PATCH] libblktap: Remove trailing null byte in xs_printf Date: Thu, 02 Oct 2008 13:51:19 +0200 Message-ID: <48E4B5B7.1080209@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020504020709080001090204" Return-path: 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 This is a multi-part message in MIME format. --------------020504020709080001090204 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit xs_printf writes the terminating null byte of the passed string to Xenstore. When reading, the null byte is returned in the following form which confuses tools: sector-size = "512\000" This patch removes the null byte from the data to write. Signed-off-by: Kevin Wolf --------------020504020709080001090204 Content-Type: text/x-patch; name="fix-xs_printf.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix-xs_printf.patch" Index: xen-unstable.hg/tools/blktap/lib/xs_api.c =================================================================== --- xen-unstable.hg.orig/tools/blktap/lib/xs_api.c +++ xen-unstable.hg/tools/blktap/lib/xs_api.c @@ -132,7 +132,7 @@ int xs_printf(struct xs_handle *h, const return ENOMEM; } - ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)+1); + ret = xs_write(h, XBT_NULL, path, buf, strlen(buf)); free(buf); free(path); --------------020504020709080001090204 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------020504020709080001090204--