]> granicus.if.org Git - php/commitdiff
Skip bug70417.phpt if lsof output looks wrong
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Aug 2020 12:36:06 +0000 (14:36 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 10 Aug 2020 13:59:08 +0000 (15:59 +0200)
On alpine lsof accepts -p but it doesn't actually do anything.
Add a crude check for whether lsof looks like Linux lsof.

ext/phar/tests/tar/bug70417.phpt

index f288efc8f57dc211ba2d2ae9c164026a838a4c16..021342c2340fce29ac06b2638813ed573a291788 100644 (file)
@@ -9,6 +9,9 @@ exec('lsof -p ' . getmypid(), $out, $status);
 if ($status !== 0) {
     die("skip lsof(8) not available");
 }
+if (!str_starts_with($out[0], 'COMMAND')) {
+    die("skip Might be a different lsof");
+}
 ?>
 --FILE--
 <?php