]> granicus.if.org Git - php/commitdiff
no readlink() on windows
authorAntony Dovgal <tony2001@php.net>
Tue, 5 Jun 2007 12:02:38 +0000 (12:02 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 5 Jun 2007 12:02:38 +0000 (12:02 +0000)
ext/spl/spl_directory.c

index f7e33b869d460a92641b4775153f2258e583b3ae..9711fb35f068908f5393e91d0af9d3dcbdd4d981 100755 (executable)
@@ -981,7 +981,11 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
                link = intern->file_name.s;
        }
 
-       ret = readlink(link, buff, MAXPATHLEN-1);
+#ifdef HAVE_SYMLINK
+       ret = readlink(intern->file_name, buff, MAXPATHLEN-1);
+#else
+       ret = -1; /* always fail if not implemented */
+#endif
 
        if (ret == -1) {
                zend_throw_exception_ex(spl_ce_RuntimeException, 0 TSRMLS_CC, "Unable to read link %R, error: %s", intern->file_name_type, intern->file_name, strerror(errno));