From 93039fbc062badf05351cc9b59f90f9b62c07781 Mon Sep 17 00:00:00 2001
From: Darren Shelley <darren.shelley@gmail.com>
Date: Fri, 26 Jul 2013 11:02:18 +0100
Subject: [PATCH] Issue #2049983 by Darren Shelley: Improve error reporting
 when PHP lacks POSIX support.

---
 commands/core/sitealias.drush.inc |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/commands/core/sitealias.drush.inc b/commands/core/sitealias.drush.inc
index ef9e26b..0384168 100644
--- a/commands/core/sitealias.drush.inc
+++ b/commands/core/sitealias.drush.inc
@@ -327,6 +327,16 @@ function _drush_sitealias_site_dir_to_uri($site_dir) {
 }
 
 /**
+ * Validation callback for drush site-set.
+ */
+function drush_sitealias_site_set_validate() {
+  if (!function_exists('posix_getppid')) {
+    $args = array('!command' => 'site-set', '!dependencies' => 'POSIX');
+    return drush_set_error('DRUSH_COMMAND_PHP_DEPENDENCY_ERROR', dt('Command !command needs the following PHP extensions installed/enabled to run: !dependencies.', $args));
+  }
+}
+
+/**
  * Set the DRUPAL_SITE variable by writing it out to a temporary file that we
  * then source for persistent site switching.
  *
-- 
1.7.9.5

