Ticket #3025: race condition when creating temporary directory.
commit33c47b5734771e54f10b2e3cf42cf2ae943b09c1
authorAmadeusz Sławiński <amade@asmblr.net>
Fri, 21 Jun 2013 09:54:11 +0000 (21 13:54 +0400)
committerAndrew Borodin <aborodin@vmail.ru>
Fri, 5 Jul 2013 16:58:41 +0000 (5 20:58 +0400)
tree5a4af6ccf9c95c4d6d2081d2614a451164afbe6d
parentff211e5fd31daca7e8e74e879d1f19f5dc159d30
Ticket #3025: race condition when creating temporary directory.

When there's no mc-tmpdir and a user tries to start two mc sessions
simultaneously, sometimes (in one out of ten attempts on my machine) one
mc session emits the following error message:

Cannot create temporary directory /tmp/mc-lars: File exists (17)
Temporary files will be created in /tmp
Press any key to continue...

Steps to reproduce:

# rm /tmp/mc-$(whoami) -rf
# uxterm -e mc & uxterm -e mc

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
lib/vfs/interface.c