Index: update.php
===================================================================
RCS file: /cvs/drupal/drupal/update.php,v
retrieving revision 1.258
diff -u -r1.258 update.php
--- update.php	9 Sep 2008 13:33:19 -0000	1.258
+++ update.php	18 Sep 2008 17:00:11 -0000
@@ -284,7 +284,14 @@
 
 function update_batch() {
   global $base_url;
-
+  
+  // During the update, toggle site maintenance so that schema changes
+  // don't effect visiting users.
+  $site_offline = variable_get('site_offline', FALSE);
+  if ($site_offline == FALSE) {
+    variable_set('site_offline', TRUE);
+  }
+  
   $operations = array();
   // Set the installed version so updates start at the correct place.
   foreach ($_POST['start'] as $module => $version) {
@@ -308,6 +315,12 @@
   );
   batch_set($batch);
   batch_process($base_url . '/update.php?op=results', $base_url . '/update.php');
+  
+  // Now that the update is done, we can disable site maintenance if
+  // it was previously turned off.
+  if ($site_offline == FALSE) {
+    variable_set('site_offline', FALSE);
+  }
 }
 
 function update_finished($success, $results, $operations) {
