php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55555
Patch bug55555.v1.phpt.patch revision 2011-08-31 16:37 UTC by datibbaw@php.net
Patch bug55555.phpt.patch revision 2011-08-31 16:25 UTC by datibbaw@php.net
Patch bug55555.patch revision 2011-08-31 16:16 UTC by datibbaw@php.net

Patch bug55555.patch for Filesystem function related Bug #55555

Patch version 2011-08-31 16:16 UTC

Return to Bug #55555 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: datibbaw@php.net

Index: ext/standard/link.c
===================================================================
--- ext/standard/link.c	(revision 315887)
+++ ext/standard/link.c	(working copy)
@@ -70,7 +70,8 @@
 	ret = php_sys_readlink(link, buff, MAXPATHLEN-1);
 
 	if (ret == -1) {
-		php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror(errno));
+		/* behaviour of readlink() changed in linux-2.6.39 to return EINVAL instead of ENOENT when the given path is empty */
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", strerror((errno != EINVAL || link_len) ? errno : ENOENT));
 		RETURN_FALSE;
 	}
 	/* Append NULL to the end of the string */
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 30 09:01:29 2024 UTC