cvs: php-src(PHP_5_3) /ext/standard/tests/file bug27508.phpt

From: Date: Mon, 18 Aug 2008 21:24:53 +0000
Subject: cvs: php-src(PHP_5_3) /ext/standard/tests/file bug27508.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-52506@lists.php.net to get a copy of this message
pajoye Mon Aug 18 21:24:53 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard/tests/file bug27508.phpt Log: - don't use /tmp as tmpdir and avoid endless loop when fopen or tmpnam failed http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/bug27508.phpt?r1=1.1.4.1&r2=1.1.4.1.2.1&diff_format=u Index: php-src/ext/standard/tests/file/bug27508.phpt diff -u php-src/ext/standard/tests/file/bug27508.phpt:1.1.4.1 php-src/ext/standard/tests/file/bug27508.phpt:1.1.4.1.2.1 --- php-src/ext/standard/tests/file/bug27508.phpt:1.1.4.1 Wed Feb 21 22:08:08 2007 +++ php-src/ext/standard/tests/file/bug27508.phpt Mon Aug 18 21:24:52 2008 @@ -42,9 +42,16 @@ stream_wrapper_register("myFile", "FileStream") or die("Failed to register protocol"); -$tn = tempnam('/tmp', 'foo'); +$tmp_dir = __DIR__; +$tn = tempnam($tmp_dir, 'foo'); +if (!$tn) { + die("tempnam failed"); +} $fp = fopen("myFile://" . urlencode($tn), "w+"); +if (!$fp) { + die("fopen failed"); +} fwrite($fp, "line1\n"); fwrite($fp, "line2\n");

« previous php.cvs (#52506) next »