core-util: Don't error out on existing runtime directory.

When compiling without HAVE_SYMLINK the runtime dir is a real directory,
which is attempted to be created. In the case it already exists we shouldn't
error out. The HAVE_SYMLINK-enabled code already does this.
This commit is contained in:
Thomas Martitz 2012-10-30 11:35:26 +01:00 committed by Arun Raghavan
parent 7e344b5ff0
commit a8e7d8bc2c

View file

@ -1789,8 +1789,9 @@ char *pa_get_runtime_dir(void) {
goto fail;
}
#else
/* No symlink possible, so let's just create the runtime directly */
if (mkdir(k) < 0)
/* No symlink possible, so let's just create the runtime directly
* Do not check again if it exists since it cannot be a symlink */
if (mkdir(k) < 0 && errno != EEXIST)
goto fail;
#endif