mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
(__getgroups): Fix the error condition check for the return value of getgroups32.
This commit is contained in:
@ -47,8 +47,8 @@
|
|||||||
#ifndef PSEUDO_END
|
#ifndef PSEUDO_END
|
||||||
#define PSEUDO_END(sym)
|
#define PSEUDO_END(sym)
|
||||||
#endif
|
#endif
|
||||||
#ifndef PSEUDO_END_NOENTRY
|
#ifndef PSEUDO_END_NOERRNO
|
||||||
#define PSEUDO_END_NOENTRY(sym)
|
#define PSEUDO_END_NOERRNO(sym) PSEUDO_END(sym)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Wrappers around system calls should normally inline the system call code.
|
/* Wrappers around system calls should normally inline the system call code.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
|
/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -36,7 +36,7 @@ extern int __syscall_getgroups32 (int, __kernel_gid32_t *__unbounded);
|
|||||||
# if __ASSUME_32BITUIDS == 0
|
# if __ASSUME_32BITUIDS == 0
|
||||||
/* This variable is shared with all files that need to check for 32bit
|
/* This variable is shared with all files that need to check for 32bit
|
||||||
uids. */
|
uids. */
|
||||||
extern int __libc_missing_32bit_uids;
|
extern int __libc_missing_32bit_uids attribute_hidden;
|
||||||
# endif
|
# endif
|
||||||
#endif /* __NR_getgroups32 */
|
#endif /* __NR_getgroups32 */
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ __getgroups (int n, gid_t *groups)
|
|||||||
int saved_errno = errno;
|
int saved_errno = errno;
|
||||||
|
|
||||||
result = INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
|
result = INLINE_SYSCALL (getgroups32, 2, n, CHECK_N (groups, n));
|
||||||
if (result == 0 || errno != ENOSYS)
|
if (result != -1 || errno != ENOSYS)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
__set_errno (saved_errno);
|
__set_errno (saved_errno);
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
|
|
||||||
/* Linux/SPARC uses a different trap number */
|
/* Linux/SPARC uses a different trap number */
|
||||||
#undef PSEUDO
|
#undef PSEUDO
|
||||||
|
#undef PSEUDO_NOERRNO
|
||||||
#undef ENTRY
|
#undef ENTRY
|
||||||
|
|
||||||
#define ENTRY(name) \
|
#define ENTRY(name) \
|
||||||
@ -101,10 +102,20 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
|
|||||||
nop; \
|
nop; \
|
||||||
SYSCALL_ERROR_HANDLER
|
SYSCALL_ERROR_HANDLER
|
||||||
|
|
||||||
|
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
||||||
|
.text; \
|
||||||
|
ENTRY(name); \
|
||||||
|
LOADSYSCALL(syscall_name); \
|
||||||
|
ta 0x6d
|
||||||
|
|
||||||
#undef PSEUDO_END
|
#undef PSEUDO_END
|
||||||
#define PSEUDO_END(name) \
|
#define PSEUDO_END(name) \
|
||||||
.size name,.-name
|
.size name,.-name
|
||||||
|
|
||||||
|
#undef PSEUDO_END_NOERRNO
|
||||||
|
#define PSEUDO_END_NOERRNO(name) \
|
||||||
|
.size name,.-name
|
||||||
|
|
||||||
#undef END
|
#undef END
|
||||||
#define END(name) \
|
#define END(name) \
|
||||||
.size name,.-name
|
.size name,.-name
|
||||||
|
Reference in New Issue
Block a user