If a chdir() call occurs before the symlink operation, the symlink is
created in the current directory rather then directory we've chdired to
because in ZTS we don't actually chdir but store the new path internally.
For an example of this problem consider the ext/standard/tests/file/001.phpt
test under ZTS.
RETURN_FALSE;
}
+#ifndef ZTS
ret = symlink(Z_STRVAL_PP(topath), Z_STRVAL_PP(frompath));
+#else
+ ret = symlink(dest_p, source_p);
+#endif
if (ret == -1) {
php_error(E_WARNING, "Symlink failed (%s)", strerror(errno));
RETURN_FALSE;
RETURN_FALSE;
}
+#ifndef ZTS
ret = link(Z_STRVAL_PP(topath), Z_STRVAL_PP(frompath));
+#else
+ ret = link(dest_p, source_p);
+#endif
if (ret == -1) {
php_error(E_WARNING, "Link failed (%s)", strerror(errno));
RETURN_FALSE;