qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Luiz Capitulino <lcapitulino@redhat.com>
Cc: blauwirbel@gmail.com, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] qemu-ga: ga_open_pidfile(): add new line to pidfile
Date: Thu, 4 Oct 2012 10:48:43 -0500	[thread overview]
Message-ID: <20121004154843.GG16157@illuin> (raw)
In-Reply-To: <20121003184001.219ab404@doriath.home>

On Wed, Oct 03, 2012 at 06:40:01PM -0300, Luiz Capitulino wrote:
> FHS requires that pid files should end with a new line. Also change to
> snprintf() while there.
> 
> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>

Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>

> ---
> 
> o v2
> 
>  - use snprintf()
>  - re-word changelog
> 
>  qemu-ga.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/qemu-ga.c b/qemu-ga.c
> index b747470..e4026f8 100644
> --- a/qemu-ga.c
> +++ b/qemu-ga.c
> @@ -255,7 +255,7 @@ static bool ga_open_pidfile(const char *pidfile)
>          g_critical("Failed to truncate pid file");
>          goto fail;
>      }
> -    sprintf(pidstr, "%d", getpid());
> +    snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
>      if (write(pidfd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
>          g_critical("Failed to write pid file");
>          goto fail;
> -- 
> 1.7.12.315.g682ce8b
> 

      reply	other threads:[~2012-10-04 16:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-03 21:40 [Qemu-devel] [PATCH v2] qemu-ga: ga_open_pidfile(): add new line to pidfile Luiz Capitulino
2012-10-04 15:48 ` Michael Roth [this message]

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=20121004154843.GG16157@illuin \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=blauwirbel@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).