If the pre-handler for the execve system call fails to state the file
being executed then propagate the error from the stat instead of just
return ENOACCES all the time. Fixes bug #110208.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4330 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c
index 16c8087..ff20a31 100644
--- a/coregrind/m_libcfile.c
+++ b/coregrind/m_libcfile.c
@@ -119,10 +119,10 @@
return res.isError ? (-1) : 0;
}
-Int VG_(stat) ( Char* file_name, struct vki_stat* buf )
+SysRes VG_(stat) ( Char* file_name, struct vki_stat* buf )
{
SysRes res = VG_(do_syscall2)(__NR_stat, (UWord)file_name, (UWord)buf);
- return res.isError ? (-1) : 0;
+ return res;
}
Int VG_(fstat) ( Int fd, struct vki_stat* buf )