]> granicus.if.org Git - php/commitdiff
merge from 5_3
authorAntony Dovgal <tony2001@php.net>
Fri, 3 Jul 2009 14:03:17 +0000 (14:03 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 3 Jul 2009 14:03:17 +0000 (14:03 +0000)
ext/sockets/tests/socket_sentto_recvfrom_unix.phpt

index 94eac3bdf589e4b92f99a20f2389934f7698031f..708d224cadcd7e934aaaff04503227ebfe6102ea 100644 (file)
@@ -26,8 +26,10 @@ if (!extension_loaded('sockets')) {
     $bytes_sent = socket_sendto($socket, $msg, $len, 0); // cause warning
     $bytes_sent = socket_sendto($socket, $msg, $len, 0, $address);
     if ($bytes_sent == -1) {
+               @unlink($address);
         die('An error occured while sending to the socket');
     } else if ($bytes_sent != $len) {
+               @unlink($address);
         die($bytes_sent . ' bytes have been sent instead of the ' . $len . ' bytes expected');
     }
 
@@ -35,13 +37,17 @@ if (!extension_loaded('sockets')) {
     var_dump(socket_recvfrom($socket, $buf, 0, 0, $from)); // expect false
     $bytes_received = socket_recvfrom($socket, $buf, 12, 0, $from);
     if ($bytes_received == -1) {
+               @unlink($address);
         die('An error occured while receiving from the socket');
     } else if ($bytes_received != $len) {
+               @unlink($address);
         die($bytes_received . ' bytes have been received instead of the ' . $len . ' bytes expected');
     }
     echo "Received $buf";
 
     socket_close($socket);
+       @unlink($address);
+?>
 --EXPECTF--
 Warning: socket_create(): Unable to create socket [93]: Protocol not supported in %s on line %d