diff --git a/src/Composer/Command/DiagnoseCommand.php b/src/Composer/Command/DiagnoseCommand.php
index 8c39a61bd..57ed3a003 100644
--- a/src/Composer/Command/DiagnoseCommand.php
+++ b/src/Composer/Command/DiagnoseCommand.php
@@ -219,8 +219,8 @@ EOT
private function checkDiskSpace($config)
{
$minSpaceFree = 1024*1024;
- if ((($df = disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
- || (($df = disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
+ if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
+ || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
) {
return 'The disk hosting '.$dir.' is full';
}
diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php
index 5b81b474b..eaef4029d 100755
--- a/src/Composer/Console/Application.php
+++ b/src/Composer/Console/Application.php
@@ -152,8 +152,8 @@ class Application extends BaseApplication
$config = $composer->getConfig();
$minSpaceFree = 1024*1024;
- if ((($df = disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
- || (($df = disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
+ if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
+ || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
) {
$output->writeln('The disk hosting '.$dir.' is full, this may be the cause of the following exception');
}