[Pkg-owncloud-commits] [owncloud] 54/153: Do not block when nothing is passed via stdin.

David Prévot taffit at moszumanska.debian.org
Tue May 27 03:05:34 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 854dd8fa7c793fdca6d9077c3519f4d55ad20eb9
Author: Andreas Fischer <bantu at owncloud.com>
Date:   Tue Apr 15 18:04:54 2014 +0200

    Do not block when nothing is passed via stdin.
---
 core/command/db/converttype.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/command/db/converttype.php b/core/command/db/converttype.php
index 8f3047b..02dc453 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list