mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 18:37:17 +00:00
server: Simplify tkill() and remove unreachable code (Smatch).
This commit is contained in:
parent
279677b7d8
commit
5c8b44cd24
|
@ -213,18 +213,17 @@ static int wait4_thread( struct thread *thread, int signal )
|
||||||
static inline int tkill( int tgid, int pid, int sig )
|
static inline int tkill( int tgid, int pid, int sig )
|
||||||
{
|
{
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
int ret = -ENOSYS;
|
|
||||||
# ifdef __i386__
|
# ifdef __i386__
|
||||||
ret = syscall(270 /*SYS_tgkill*/, tgid, pid, sig);
|
int ret = syscall(270 /*SYS_tgkill*/, tgid, pid, sig);
|
||||||
if (ret < 0 && errno == -ENOSYS)
|
if (ret < 0 && errno == -ENOSYS)
|
||||||
ret = syscall(238 /*SYS_tkill*/, pid, sig);
|
ret = syscall(238 /*SYS_tkill*/, pid, sig);
|
||||||
return ret;
|
return ret;
|
||||||
# elif defined(__x86_64__)
|
# elif defined(__x86_64__)
|
||||||
return syscall(200 /*SYS_tkill*/, pid, sig);
|
return syscall(200 /*SYS_tkill*/, pid, sig);
|
||||||
# endif
|
# else
|
||||||
if (ret >= 0) return ret;
|
errno = ENOSYS;
|
||||||
errno = -ret;
|
|
||||||
return -1;
|
return -1;
|
||||||
|
# endif
|
||||||
#elif defined(__FreeBSD__) && defined(HAVE_THR_KILL2)
|
#elif defined(__FreeBSD__) && defined(HAVE_THR_KILL2)
|
||||||
return thr_kill2( tgid, pid, sig );
|
return thr_kill2( tgid, pid, sig );
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue