diff options
author | Andreas Fischer <bantu@owncloud.com> | 2014-04-15 18:04:54 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-04-15 18:04:54 +0200 |
commit | 854dd8fa7c793fdca6d9077c3519f4d55ad20eb9 (patch) | |
tree | cff05b2fd7b3784222408c375a2f9ec35bfae635 /core/command | |
parent | d2c7a8ee59d57be1441f771ff00350d5f677999f (diff) | |
download | nextcloud-server-854dd8fa7c793fdca6d9077c3519f4d55ad20eb9.tar.gz nextcloud-server-854dd8fa7c793fdca6d9077c3519f4d55ad20eb9.zip |
Do not block when nothing is passed via stdin.
Diffstat (limited to 'core/command')
-rw-r--r-- | core/command/db/converttype.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php index 8f3047b8a0b..02dc45383e8 100644 --- a/core/command/db/converttype.php +++ b/core/command/db/converttype.php @@ -123,8 +123,11 @@ class ConvertType extends Command { return; } - // Read from stdin + // Read from stdin. stream_set_blocking is used to prevent blocking + // when nothing is passed via stdin. + stream_set_blocking(STDIN, 0); $password = file_get_contents('php://stdin'); + stream_set_blocking(STDIN, 1); if (trim($password) !== '') { $input->setOption('password', $password); return; |