Skip to content
Snippets Groups Projects
  • Rob Swindell's avatar
    a0d46cde
    Resolve race condition around temp directory creation · a0d46cde
    Rob Swindell authored
    It's possible that isdir(temp_dir) will be false and then a mkpath()
    call will fail because some other thread came in and crated the
    directory at that very moment - so save errno if mkdir fails and
    call isdir() again to double-check that the directory wasn't created
    by someone else already.
    a0d46cde
    History
    Resolve race condition around temp directory creation
    Rob Swindell authored
    It's possible that isdir(temp_dir) will be false and then a mkpath()
    call will fail because some other thread came in and crated the
    directory at that very moment - so save errno if mkdir fails and
    call isdir() again to double-check that the directory wasn't created
    by someone else already.