All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Julia Suvorova <jusual@mail.ru>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>
Cc: Jim Mussared <jim@groklearning.com>,
	Joel Stanley <joel@jms.id.au>,
	Richard Henderson <rth@twiddle.net>,
	Cornelia Huck <cohuck@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] use g_path_get_basename instead of basename
Date: Thu, 1 Mar 2018 12:19:58 +0100	[thread overview]
Message-ID: <63219f38-05e9-5154-81a8-034d0994761d@redhat.com> (raw)
In-Reply-To: <1519888086-4207-1-git-send-email-jusual@mail.ru>

On 01/03/2018 08:08, Julia Suvorova wrote:
> +static void free_progname(void)
> +{
> +    g_free(progname);
> +}
> +
>  static void GCC_FMT_ATTR(2, 3) readline_printf_func(void *opaque,
>                                                      const char *fmt, ...)
>  {
> @@ -504,7 +509,8 @@ int main(int argc, char **argv)
>  #endif
>  
>      module_call_init(MODULE_INIT_TRACE);
> -    progname = basename(argv[0]);
> +    progname = g_path_get_basename(argv[0]);
> +    atexit(free_progname);

This atexit is not needed; memory is always freed on exit.  But, it's
good that you thought about it!

I can queue this patch for merging once I get an ack from Alex
Williamson (VFIO).

Thanks,

Paolo

  parent reply	other threads:[~2018-03-01 11:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01  7:08 [Qemu-devel] [PATCH] use g_path_get_basename instead of basename Julia Suvorova
2018-03-01  9:47 ` Marc-André Lureau
2018-03-01 10:59   ` Cornelia Huck
2018-03-01 11:21     ` Paolo Bonzini
2018-03-01 12:02       ` Julia Suvorova
2018-03-01 11:25     ` Julia Suvorova
2018-03-01 11:19 ` Paolo Bonzini [this message]
2018-03-01 16:20 ` Alex Williamson
2018-03-02 10:50   ` Paolo Bonzini
2018-03-02 15:20   ` Eric Blake

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=63219f38-05e9-5154-81a8-034d0994761d@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jim@groklearning.com \
    --cc=joel@jms.id.au \
    --cc=jusual@mail.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.