Ignore spurious stderr output from lsof
authorSara Golemon <pollita@php.net>
Thu, 1 Jun 2017 22:40:26 +0000 (15:40 -0700)
committerSara Golemon <pollita@php.net>
Thu, 1 Jun 2017 22:43:25 +0000 (15:43 -0700)
lsof may report errors trying to stat files owned by other
users in other processes, even when asking for files
associated to a specific process.  Boo.

ext/phar/tests/tar/bug70417.phpt

index 0096b5a2a91591d008c74180c2e0734f15f8e04f..9d30aae7a973213069b4dfeb10b1c7afe855903f 100644 (file)
@@ -13,7 +13,7 @@ if ($status !== 0) {
 --FILE--
 <?php
 function countOpenFiles() {
-    exec('lsof -p ' . getmypid(), $out);
+    exec('lsof -p ' . getmypid() . ' 2> /dev/null', $out);
     return count($out);
 }
 $filename = __DIR__ . '/bug70417.tar';