
Hi Steve, thanks for the patch. I did not test it, but it looks good to me. Gerd Steve Ratcliffe wrote
Hi Gerd
I've just noted for the first time that mkgmap may fail if the output directory doesn't exist and -max-jobs is used.
to be fixed with a threadlocal variable?
A thread local variable is almost never the correct way to fix a thread problem.
I think that in this case where the return from mkdirs() does not distinguish between failure and directory already existing we should just ignore the return value and test if the directory does actually exist afterwards.
Patch attached. Of course there can still be multiple messages, but I don't see that as a problem.
Could remove the message about creating the directory altogether, in which case the 'if exists' part could be removed too since mkdirs() tests if the directory exists as the first thing it does itself.
..Steve
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Race_on_create_directory_.patch (758 bytes) <http://gis.19327.n5.nabble.com/attachment/5774769/0/Race_on_create_directory...;
-- View this message in context: http://gis.19327.n5.nabble.com/possible-problem-if-output-dir-doesn-t-exist-... Sent from the Mkgmap Development mailing list archive at Nabble.com.