]> git.openstreetmap.org Git - nominatim.git/commitdiff
break out of write loop when psql fails
authorSarah Hoffmann <lonvia@denofr.de>
Tue, 13 May 2014 21:17:05 +0000 (23:17 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Tue, 13 May 2014 21:17:05 +0000 (23:17 +0200)
fixes hanging in --create-functions

utils/setup.php

index 9e946035c6e4ff8201dd69fa0cf67b19a40d8a27..e256289cd6cd985373b2224fa3fa5afed1b2395a 100755 (executable)
                while(strlen($sScript))
                {
                        $written = fwrite($ahPipes[0], $sScript);
                while(strlen($sScript))
                {
                        $written = fwrite($ahPipes[0], $sScript);
+                       if ($written <= 0) break;
                        $sScript = substr($sScript, $written);
                }
                fclose($ahPipes[0]);
                        $sScript = substr($sScript, $written);
                }
                fclose($ahPipes[0]);