scripts/runqemu-internal: Fix lock races
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Mar 2013 22:58:30 +0000 (22:58 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Mar 2013 23:09:45 +0000 (23:09 +0000)
commitda794accda4ef5c27f639e742a15c1bf1d1c0100
tree4d8c1e5aaac4e0941c0fee00ae64852c12ece4b2
parent8a15da7ebdc962e4538d3ef5fe486456bd791248
scripts/runqemu-internal: Fix lock races

There are two problems here. Firstly the grep command is unanchored so
pid 345 will match against 12345 and so on.

The second issue is that there are several context switched between attempting
the lock and then writing the pid to it.

Between the two issues, there were issues appearing on the autobuilder due
to these conflicts. This patch replaces the mechanism with flock on fd 8
which should be a safer mechanism to use.

(From OE-Core rev: 98471be6e58451016200cfd10e64e8ae6266c801)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu-internal