From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38032 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUuej-0005gg-9U for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:21:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUueg-00058m-LH for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:21:01 -0500 Received: from e28smtp04.in.ibm.com ([122.248.162.4]:40750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUuef-00055s-Uq for qemu-devel@nongnu.org; Tue, 21 Dec 2010 00:20:58 -0500 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp04.in.ibm.com (8.14.4/8.13.1) with ESMTP id oBL5Kqkp016842 for ; Tue, 21 Dec 2010 10:50:52 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oBL5KqX21437884 for ; Tue, 21 Dec 2010 10:50:52 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oBL5KpO5014711 for ; Tue, 21 Dec 2010 10:50:51 +0530 From: Harsh Prateek Bora Date: Tue, 21 Dec 2010 10:50:48 +0530 Message-Id: <1292908848-8381-1-git-send-email-harsh@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH v2] hw/virtio-9p-local.c: Remove unnecessary null char in symlink file List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Harsh Prateek Bora This patch removes the addition of null char in symlink file which is being appended to file in case of mapped security model. Without this patch, the extra null char causes LTP testcase lstat03 to fail and hence this fix is required. v2: - Description updated to mention about LTP lstat testcase failure without this patch. Signed-off-by: Harsh Prateek Bora --- hw/virtio-9p-local.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-9p-local.c b/hw/virtio-9p-local.c index 656bfb3..3b6447d 100644 --- a/hw/virtio-9p-local.c +++ b/hw/virtio-9p-local.c @@ -370,7 +370,7 @@ static int local_symlink(FsContext *fs_ctx, const char *oldpath, return fd; } /* Write the oldpath (target) to the file. */ - oldpath_size = strlen(oldpath) + 1; + oldpath_size = strlen(oldpath); do { write_size = write(fd, (void *)oldpath, oldpath_size); } while (write_size == -1 && errno == EINTR); -- 1.7.1.1