mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-23 16:08:41 -07:00
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>
This commit is contained in:
parent
6a3c8c14c8
commit
9d6f1b73f8
1 changed files with 1 additions and 1 deletions
|
|
@ -255,7 +255,7 @@ static bool ga_open_pidfile(const char *pidfile)
|
||||||
g_critical("Failed to truncate pid file");
|
g_critical("Failed to truncate pid file");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
sprintf(pidstr, "%d", getpid());
|
snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
|
||||||
if (write(pidfd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
|
if (write(pidfd, pidstr, strlen(pidstr)) != strlen(pidstr)) {
|
||||||
g_critical("Failed to write pid file");
|
g_critical("Failed to write pid file");
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue