Re: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace

Jan Kratochvil
2012-03-06T08:42:18Z

On Tue, 06 Mar 2012 09:35:28 +0100, Mark Kettenis wrote:
> > + int save_errno;
> > +
> > + errno = 0;
> > + if (ptrace (PTRACE_TRACEME, 0, NULL, NULL) == 0)
> > + return;
>
> Setting errno to zero here is pointless isn't it?
>
> > + save_errno = errno;

In fact yes, I will remove it.

> > inf_ptrace_me (void)
> > {
> > /* "Trace me, Dr. Memory!" */
> > + errno = 0;
> > ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3)0, 0);
> > + if (errno != 0)
> > + {
> > + fprintf_unfiltered (gdb_stderr, _("Cannot create process: %s\n"),
>
> "Cannot trace process: %s"?

I wanted to make clearly distinct this spawning-process case from the
attaching-process case. I will change it, it is clear from the context
anyway.

Thanks,
Jan