qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] bug writing pidfile under unix (and fix)


From: Anthony Liguori
Subject: Re: [Qemu-devel] bug writing pidfile under unix (and fix)
Date: Fri, 07 Nov 2008 14:15:54 -0600
User-agent: Thunderbird 2.0.0.17 (X11/20080925)

Paul Brook wrote:
On Friday 07 November 2008, Jim Bailey wrote:
Hello,

In qemu_create_pidfile (osdep.c:229) the current pid and a newline is
written to the pidfile. However, the pidfile isn't truncated, so if it
is longer than the length of the pid and the newline character you get
trailing junk that can really mess up scripts.

Shouldn't we just open with O_TRUNC ?

Definitely.

I also notice that we're not removing the file when we exit.

It's not terribly useful to remove the file but it couldn't hurt. An advisory lock is used to ensure that only one process is running at a given time.

Regards,

Anthony Liguori

Paul







reply via email to

[Prev in Thread] Current Thread [Next in Thread]