From: André Hentschel Subject: server: Get rid of defined but not used warning caused by a superfluous helper function (resend) Message-Id: <54E88F6F.3050500@dawncrow.de> Date: Sat, 21 Feb 2015 15:00:15 +0100 --- server/ptrace.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/server/ptrace.c b/server/ptrace.c index cb436b6..5deab9b 100644 --- a/server/ptrace.c +++ b/server/ptrace.c @@ -163,13 +163,6 @@ static int get_ptrace_pid( struct thread *thread ) return thread->unix_pid; } -/* return the Unix tid to use in ptrace calls for a given thread */ -static int get_ptrace_tid( struct thread *thread ) -{ - if (thread->unix_tid != -1) return thread->unix_tid; - return thread->unix_pid; -} - /* wait for a ptraced child to get a certain signal */ static int waitpid_thread( struct thread *thread, int signal ) { @@ -545,7 +538,7 @@ void get_selector_entry( struct thread *thread, int entry, unsigned int *base, /* retrieve the thread x86 registers */ void get_thread_context( struct thread *thread, context_t *context, unsigned int flags ) { - int i, pid = get_ptrace_tid(thread); + int i, pid = (thread->unix_tid == -1) ? thread->unix_pid : thread->unix_tid; long data[8]; /* all other regs are handled on the client side */ @@ -594,7 +587,7 @@ done: /* set the thread x86 registers */ void set_thread_context( struct thread *thread, const context_t *context, unsigned int flags ) { - int pid = get_ptrace_tid( thread ); + int pid = (thread->unix_tid == -1) ? thread->unix_pid : thread->unix_tid; /* all other regs are handled on the client side */ assert( flags == SERVER_CTX_DEBUG_REGISTERS ); @@ -655,7 +648,7 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign /* retrieve the thread x86 registers */ void get_thread_context( struct thread *thread, context_t *context, unsigned int flags ) { - int pid = get_ptrace_tid(thread); + int pid = (thread->unix_tid == -1) ? thread->unix_pid : thread->unix_tid; struct dbreg dbregs; /* all other regs are handled on the client side */ @@ -690,7 +683,7 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int /* set the thread x86 registers */ void set_thread_context( struct thread *thread, const context_t *context, unsigned int flags ) { - int pid = get_ptrace_tid(thread); + int pid = (thread->unix_tid == -1) ? thread->unix_pid : thread->unix_tid; struct dbreg dbregs; /* all other regs are handled on the client side */