qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [7130] linux-user: fix getcwd syscall
@ 2009-04-16 14:17 Aurelien Jarno
  0 siblings, 0 replies; only message in thread
From: Aurelien Jarno @ 2009-04-16 14:17 UTC (permalink / raw)
  To: qemu-devel

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-16 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 14:17 [Qemu-devel] [7130] linux-user: fix getcwd syscall Aurelien Jarno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).