[bitbake-devel] [PATCH] lib/bb/utils: fix set_process_name

Christopher Larson clarson at kergoth.com
Tue Jul 12 15:20:29 UTC 2016


On Tue, Jul 12, 2016 at 8:15 AM, Ross Burton <ross.burton at intel.com> wrote:

> With Python 3 create_string_buffer needs a bytes() not a str() but as we
> were
> catching all exceptions nobody noticed.
>
> [ YOCTO #9910 ]
>
> Signed-off-by: Ross Burton <ross.burton at intel.com>
> ---
>  bitbake/lib/bb/utils.py | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
> index 0a1bf68..3bc2437 100644
> --- a/bitbake/lib/bb/utils.py
> +++ b/bitbake/lib/bb/utils.py
> @@ -1444,9 +1444,8 @@ def set_process_name(name):
>      # This is nice to have for debugging, not essential
>      try:
>          libc = cdll.LoadLibrary('libc.so.6')
> -        buff = create_string_buffer(len(name)+1)
> -        buff.value = name
> -        libc.prctl(15, byref(buff), 0, 0, 0)
> +        buf = create_string_buffer(bytes(name, 'utf-8'))
> +        libc.prctl(15, byref(buf), 0, 0, 0)
>      except:
>          pass
>

Why are we catching all exceptions, anyway? That's not usually a good idea.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20160712/0ae9f269/attachment-0002.html>


More information about the bitbake-devel mailing list