diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2012-10-03 18:40:01 -0300 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2012-10-09 03:42:42 -0500 |
commit | 9d6f1b73f83a02fb28438fa9a487f5c7d245e4af (patch) | |
tree | 569570bc7265c91b63bc146bc121e9eb73171c9f | |
parent | 6a3c8c14c8467c5db3539f1b6e43e03318e5e21b (diff) | |
download | qemu-9d6f1b73f83a02fb28438fa9a487f5c7d245e4af.zip qemu-9d6f1b73f83a02fb28438fa9a487f5c7d245e4af.tar.gz qemu-9d6f1b73f83a02fb28438fa9a487f5c7d245e4af.tar.bz2 |
qemu-ga: ga_open_pidfile(): add new line to pidfile
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>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r-- | qemu-ga.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |