mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Use fcntl F_SETLK, rather than writing our pid into a "lock" file. That way if we crash we don't leave the lockfile lying about. Callers now need to keep the fd for our lockfile. (We don't use flock because we don't want anyone who inherits this fd across fork to end up with a handle onto the lock.) While we are here: * Move the lockfile to /var/run/xen * De-duplicate the calculation of the pathname * Compute the buffer size for the pathname so that it will definitely not overrun (and use the computed value everywhere) * Fix various error handling bugs Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
The file test.py here is from the Zope project, and is Copyright (c) 2001, 2002 Zope Corporation and Contributors. This file is released under the Zope Public License, version 2.0, a copy of which is in the file ZPL-2.0.