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

index 07cf43e4b4a3f6b8bd9b9be2c3d7315f56bc3a3f..b9fc22dfdd7b066ecad2863e1420873d07a4ccc7 100755 (executable)
@@ -829,7 +829,11 @@ SPL_METHOD(SplFileInfo, getLinkTarget)
 
        php_set_error_handling(EH_THROW, spl_ce_RuntimeException TSRMLS_CC);
 
+#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 %s, error: %s", intern->file_name, strerror(errno));