This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]