This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
RE: fixed thread names with posix pthreads
- From: Jay Foster <jay at systech dot com>
- To: 'Gary Thomas' <gary at mlbassoc dot com>, Stefan Sommerfeld <sommerfeld at mikrom dot de>
- Cc: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Fri, 21 Oct 2005 13:06:58 -0700
- Subject: RE: fixed thread names with posix pthreads
It looks like the code is just fine the way it is. The statement
name[16] = '\0';
further down NUL terminates the name[] string. name[] is copied from a
template, which has a fixed length.
Jay
-----Original Message-----
From: Gary Thomas [mailto:gary@mlbassoc.com]
Sent: Friday, October 21, 2005 8:00 AM
To: Stefan Sommerfeld
Cc: eCos patches
Subject: Re: fixed thread names with posix pthreads
On Fri, 2005-10-21 at 16:32 +0200, Stefan Sommerfeld wrote:
> Hi,
>
> There was the zero termination missing with the thread name in
> pthread_create().
Why rewrite the whole loop (and make it more complicated)?
It would be sufficient to just add one line to put in the
termination character. Just add this line after the for loop:
name[i] = '\0';
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------