public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 1/1] uml: fix some ptrace functions returns values
@ 2004-11-24  0:07 blaisorblade_spam
  2004-11-24  2:50 ` Randy.Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: blaisorblade_spam @ 2004-11-24  0:07 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, user-mode-linux-devel, blaisorblade_spam, jdike


From: Jeff Dike <jdike@addtoit.com>

This patch adds ptrace_setfpregs and makes these functions return -errno on
failure.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---

 linux-2.6.10-rc-paolo/arch/um/sys-i386/ptrace_user.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff -puN arch/um/sys-i386/ptrace_user.c~uml-fix-ptrace-interfaces arch/um/sys-i386/ptrace_user.c
--- linux-2.6.10-rc/arch/um/sys-i386/ptrace_user.c~uml-fix-ptrace-interfaces	2004-11-24 01:06:35.525806848 +0100
+++ linux-2.6.10-rc-paolo/arch/um/sys-i386/ptrace_user.c	2004-11-24 01:06:35.528806392 +0100
@@ -17,17 +17,30 @@
 
 int ptrace_getregs(long pid, unsigned long *regs_out)
 {
-	return(ptrace(PTRACE_GETREGS, pid, 0, regs_out));
+	if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
+		return(-errno);
+	return(0);
 }
 
 int ptrace_setregs(long pid, unsigned long *regs)
 {
-	return(ptrace(PTRACE_SETREGS, pid, 0, regs));
+	if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
+		return(-errno);
+	return(0);
 }
 
 int ptrace_getfpregs(long pid, unsigned long *regs)
 {
-	return(ptrace(PTRACE_GETFPREGS, pid, 0, regs));
+	if(ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0)
+		return(-errno);
+	return(0);
+}
+
+int ptrace_setfpregs(long pid, unsigned long *regs)
+{
+	if(ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
+		return(-errno);
+	return(0);
 }
 
 static void write_debugregs(int pid, unsigned long *regs)
_

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 1/1] uml: fix some ptrace functions returns values
  2004-11-24  0:07 [patch 1/1] uml: fix some ptrace functions returns values blaisorblade_spam
@ 2004-11-24  2:50 ` Randy.Dunlap
  2004-11-25  4:14   ` [uml-devel] " Blaisorblade
  0 siblings, 1 reply; 3+ messages in thread
From: Randy.Dunlap @ 2004-11-24  2:50 UTC (permalink / raw)
  To: blaisorblade_spam; +Cc: akpm, linux-kernel, user-mode-linux-devel, jdike

blaisorblade_spam@yahoo.it wrote:
> From: Jeff Dike <jdike@addtoit.com>
> 
> This patch adds ptrace_setfpregs and makes these functions return -errno on
> failure.
> 
> Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
> ---
> 
>  linux-2.6.10-rc-paolo/arch/um/sys-i386/ptrace_user.c |   19 ++++++++++++++++---
>  1 files changed, 16 insertions(+), 3 deletions(-)
> 
> diff -puN arch/um/sys-i386/ptrace_user.c~uml-fix-ptrace-interfaces arch/um/sys-i386/ptrace_user.c
> --- linux-2.6.10-rc/arch/um/sys-i386/ptrace_user.c~uml-fix-ptrace-interfaces	2004-11-24 01:06:35.525806848 +0100
> +++ linux-2.6.10-rc-paolo/arch/um/sys-i386/ptrace_user.c	2004-11-24 01:06:35.528806392 +0100
> @@ -17,17 +17,30 @@
>  
>  int ptrace_getregs(long pid, unsigned long *regs_out)
>  {
> -	return(ptrace(PTRACE_GETREGS, pid, 0, regs_out));
> +	if(ptrace(PTRACE_GETREGS, pid, 0, regs_out) < 0)
> +		return(-errno);
> +	return(0);
>  }
>  
>  int ptrace_setregs(long pid, unsigned long *regs)
>  {
> -	return(ptrace(PTRACE_SETREGS, pid, 0, regs));
> +	if(ptrace(PTRACE_SETREGS, pid, 0, regs) < 0)
> +		return(-errno);
> +	return(0);
>  }
>  
>  int ptrace_getfpregs(long pid, unsigned long *regs)
>  {
> -	return(ptrace(PTRACE_GETFPREGS, pid, 0, regs));
> +	if(ptrace(PTRACE_GETFPREGS, pid, 0, regs) < 0)
> +		return(-errno);
> +	return(0);
> +}
> +
> +int ptrace_setfpregs(long pid, unsigned long *regs)
> +{
> +	if(ptrace(PTRACE_SETFPREGS, pid, 0, regs) < 0)
> +		return(-errno);
> +	return(0);
>  }
>  
>  static void write_debugregs(int pid, unsigned long *regs)

Looks OK except that someone's SPACEBAR is broken (missing)
and there are (unneeded/unwanted) parens on the returns.

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [uml-devel] Re: [patch 1/1] uml: fix some ptrace functions returns values
  2004-11-24  2:50 ` Randy.Dunlap
@ 2004-11-25  4:14   ` Blaisorblade
  0 siblings, 0 replies; 3+ messages in thread
From: Blaisorblade @ 2004-11-25  4:14 UTC (permalink / raw)
  To: user-mode-linux-devel; +Cc: Randy.Dunlap, akpm, linux-kernel, jdike

On Wednesday 24 November 2004 03:50, Randy.Dunlap wrote:
> blaisorblade_spam@yahoo.it wrote:
> > From: Jeff Dike <jdike@addtoit.com>
> >
> > This patch adds ptrace_setfpregs and makes these functions return -errno
> > on failure.

> Looks OK except that someone's SPACEBAR is broken (missing)
> and there are (unneeded/unwanted) parens on the returns.
Yes, that is Jeff Dike's keyboard - it's cursing all over arch/um with that 
style.

I'm going to resend it more conforming to the kernel style.
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-25  5:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-24  0:07 [patch 1/1] uml: fix some ptrace functions returns values blaisorblade_spam
2004-11-24  2:50 ` Randy.Dunlap
2004-11-25  4:14   ` [uml-devel] " Blaisorblade

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox