mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 13:00:06 +00:00
MIPS: Setup errno for {f,l,}xstat
{f,l,}xstat stub for MIPS is using INTERNAL_SYSCALL to do xstat syscall for glibc ver, However it leaves errno untouched and thus giving bad errno output. Setup errno properly when syscall returns non-zero. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
4e04a47208
commit
66016ec8ae
@ -35,7 +35,9 @@ __fxstat (int vers, int fd, struct stat *buf)
|
||||
{
|
||||
struct kernel_stat kbuf;
|
||||
int r = INTERNAL_SYSCALL_CALL (fstat, fd, &kbuf);
|
||||
return r ?: __xstat_conv (vers, &kbuf, buf);
|
||||
if (r == 0)
|
||||
return __xstat_conv (vers, &kbuf, buf);
|
||||
return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,9 @@ __lxstat (int vers, const char *name, struct stat *buf)
|
||||
{
|
||||
struct kernel_stat kbuf;
|
||||
int r = INTERNAL_SYSCALL_CALL (lstat, name, &kbuf);
|
||||
return r ?: __xstat_conv (vers, &kbuf, buf);
|
||||
if (r == 0)
|
||||
return __xstat_conv (vers, &kbuf, buf);
|
||||
return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,9 @@ __xstat (int vers, const char *name, struct stat *buf)
|
||||
{
|
||||
struct kernel_stat kbuf;
|
||||
int r = INTERNAL_SYSCALL_CALL (stat, name, &kbuf);
|
||||
return r ?: __xstat_conv (vers, &kbuf, buf);
|
||||
if (r == 0)
|
||||
return __xstat_conv (vers, &kbuf, buf);
|
||||
return INLINE_SYSCALL_ERROR_RETURN_VALUE (-r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user