Seems and work ok.
J.
On 10/14/2010 04:32 PM, Denys Vlasenko wrote:
Jiri found a bug in previous patch, so here goes v.2
Before this patch, dd_opendir(".") was creating
lock file "..lock", which is obviously wrong.
This patch makes dd_opendir use realpath(dir).
This makes dd_opendir(".") and similar cases correctly
determine what's its parent directory and therefore
use correct lock file name.
dd_create can't use realpath, since it will always return NULL
on not-yet existing directory. But this is not a problem, since
dd_create(".") isn't a sane operation. So we continue to use
old code. I only added a sanity check to refuse names ending
in . and .. - just in case.
Run-tested.
Please review.