[Pm-utils] lockfile creation not really atomic in pm-utils

Victor Lowther victor.lowther at gmail.com
Fri Jan 4 13:02:19 PST 2008

While browsing through the source of pm-utils, I noticed that the
lock/unlocking functions were using file creation/removal and PID
checking for locking purposes.  In a shell scripting language,
however, there is no way to atomically create files.

Directory creation, however, is atomic.  Here is a patch to atomicize
the lock/unlick functions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pm-utils-atomicise-pm-lock.patch
Type: text/x-patch
Size: 1683 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/pm-utils/attachments/20080104/4c29ab2f/attachment.bin 

More information about the Pm-utils mailing list