[7130] linux-user: fix getcwd syscall
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 <[email protected]>
Acked-by Riku Voipio <[email protected]>
Signed-off-by Aurelien Jarno <[email protected]>
Modified Paths:
--------------
trunk/linux-user/syscall.c
Modified: trunk/linux-user/syscall.c
===================================================================
linux-user/syscall.c +1 -1
@@ -293,7 +293,7 @@/* getcwd() sets errno */ return (-1 ); } -return (0 ); +return strlen (buf)+1 ; }#ifdef CONFIG_ATFILE