Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Doug Evans <dje@google.com>
Cc: Pedro Alves <pedro@codesourcery.com>,  gdb-patches@sourceware.org
Subject: Re: Workaround for glibc/BZ5983: following a child fork shows stale  	parent threads in the child.
Date: Tue, 19 May 2009 09:52:00 -0000	[thread overview]
Message-ID: <m2fxf1qv28.fsf@igel.home> (raw)
In-Reply-To: <e394668d0905182326r7e481761o28d5445c9362bc05@mail.gmail.com> 	(Doug Evans's message of "Mon, 18 May 2009 23:26:07 -0700")

Doug Evans <dje@google.com> writes:

> On Mon, May 18, 2009 at 10:13 AM, Pedro Alves <pedro@codesourcery.com> wrote:
>> [...]
>> +      while (fgets (buf, sizeof (buf), status_file))
>> +       {
>> +         if (strncmp (buf, "Tgid:", 5) == 0)
>> +           {
>> +             tgid = strtoul (buf + strlen ("Tgid:"), NULL, 10);
>> +             break;
>> +           }
>> +       }
>
> This works, but only because of an assumption of the strlen including
> the trailing NUL in "Tgid:" consuming the TAB between "Tgid:" and the
> number.

strlen does not include the trailing NUL, sizeof does.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


  reply	other threads:[~2009-05-19  9:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-18 17:13 Pedro Alves
2009-05-19  6:26 ` Doug Evans
2009-05-19  9:52   ` Andreas Schwab [this message]
2009-05-19  9:56   ` Pedro Alves
2009-05-19 14:28   ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2fxf1qv28.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox