提交 aaf4ad39 编写于 作者: A aurel32

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: NArnaud Patard <arnaud.patard@rtp-net.org>
Acked-By: NRiku Voipio <riku.voipio@iki.fi>
Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7130 c046a42c-6fe2-441c-8c8c-71466251a162
上级 69a218fc
......@@ -293,7 +293,7 @@ static int sys_getcwd1(char *buf, size_t size)
/* getcwd() sets errno */
return (-1);
}
return (0);
return strlen(buf)+1;
}
#ifdef CONFIG_ATFILE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册