Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LuSP0-0001dl-KU for qemu-devel@nongnu.org; Thu, 16 Apr 2009 10:17:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LuSOz-0001dY-Tf for qemu-devel@nongnu.org; Thu, 16 Apr 2009 10:17:18 -0400 Received: from [199.232.76.173] (port=39165 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LuSOz-0001dV-Qu for qemu-devel@nongnu.org; Thu, 16 Apr 2009 10:17:17 -0400 Received: from savannah.gnu.org ([199.232.41.3]:33550 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LuSOz-0003Tm-K2 for qemu-devel@nongnu.org; Thu, 16 Apr 2009 10:17:17 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1LuSOx-0007bQ-GG for qemu-devel@nongnu.org; Thu, 16 Apr 2009 14:17:15 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1LuSOx-0007bL-0D for qemu-devel@nongnu.org; Thu, 16 Apr 2009 14:17:15 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Thu, 16 Apr 2009 14:17:15 +0000 Subject: [Qemu-devel] [7130] linux-user: fix getcwd syscall Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 7130 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=7130 Author: aurel32 Date: 2009-04-16 14:17:14 +0000 (Thu, 16 Apr 2009) Log Message: ----------- linux-user: fix getcwd syscall The patch called "prefer glibc over direct syscalls" (commit 7118) has replaced the getcwd syscall with a call to the glibc. With this change, the syscall is returning -1 in error case and 0 otherwise. This is problematic as the sys_getcwd syscall should return the number of bytes written to the buffer including the '\0'. Signed-off-by: Arnaud Patard Acked-By: Riku Voipio Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/linux-user/syscall.c Modified: trunk/linux-user/syscall.c =================================================================== --- trunk/linux-user/syscall.c 2009-04-16 12:57:58 UTC (rev 7129) +++ trunk/linux-user/syscall.c 2009-04-16 14:17:14 UTC (rev 7130) @@ -293,7 +293,7 @@ /* getcwd() sets errno */ return (-1); } - return (0); + return strlen(buf)+1; } #ifdef CONFIG_ATFILE