From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1394 invoked by alias); 6 Mar 2012 08:42:18 -0000 Received: (qmail 1380 invoked by uid 22791); 6 Mar 2012 08:42:18 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Mar 2012 08:41:59 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q268fwYg026074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Mar 2012 03:41:58 -0500 Received: from host2.jankratochvil.net (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q268fs14022610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 6 Mar 2012 03:41:57 -0500 Date: Tue, 06 Mar 2012 08:42:00 -0000 From: Jan Kratochvil To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [patch 3/3] attach-fail-reasons: SELinux deny_ptrace Message-ID: <20120306084154.GA28267@host2.jankratochvil.net> References: <20120306061739.GC24004@host2.jankratochvil.net> <201203060835.q268ZSZY010637@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201203060835.q268ZSZY010637@glazunov.sibelius.xs4all.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-03/txt/msg00174.txt.bz2 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