List:Internals« Previous MessageNext Message »
From:pkarthick Date:January 25 2006 1:22pm
Subject:bk commit into 4.0 tree (pkarthick:1.2161)
View as plain text  
Below is the list of changes that have just been committed into a local
4.0 repository of prem. When prem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2161 06/01/25 18:52:39 pkarthick@stripped[prem] +1 -0
  4.0.x_multi_mysqld_safe.patch

  netware/mysqld_safe.c
    1.9 05/11/30 13:32:55 pkarthick@stripped[prem] +15 -27
    Import patch 4.0.x_multi_mysqld_safe.patch

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	pkarthick
# Host:	blr-naas-nwl04.blr.novell.com
# Root:	/home/prem/Sawtooth_SP2

--- 1.8/netware/mysqld_safe.c	2004-01-29 22:09:00 +05:30
+++ 1.9/netware/mysqld_safe.c	2005-11-30 13:32:55 +05:30
@@ -271,51 +271,39 @@
 ******************************************************************************/
 void read_defaults(arg_list_t *pal)
 {
-  arg_list_t al;
-  char defaults_file[PATH_MAX];
   char mydefaults[PATH_MAX];
+  char mydefaults_command[3*PATH_MAX];
   char line[PATH_MAX];
   FILE *fp;
   
-	// defaults output file
-	snprintf(defaults_file, PATH_MAX, "%s/bin/defaults.out", basedir);
-	remove(defaults_file);
-
-	// mysqladmin file
+	// my_print_defaults file
   snprintf(mydefaults, PATH_MAX, "%s/bin/my_print_defaults", basedir);
 	
-  // args
-  init_args(&al);
-  add_arg(&al, mydefaults);
-  if (default_option[0]) add_arg(&al, default_option);
-  add_arg(&al, "mysqld");
-  add_arg(&al, "server");
-  add_arg(&al, "mysqld_safe");
-  add_arg(&al, "safe_mysqld");
-
-	spawn(mydefaults, &al, TRUE, NULL, defaults_file, NULL);
-
-  free_args(&al);
-
+  // args to my_print_defaults
+  if (default_option[0]) 
+  {
+    snprintf(mydefaults_command, 3*PATH_MAX, "%s %s mysqld server mysqld_safe safe_mysqld", mydefaults, default_option);
+  }
+  else
+  {
+    snprintf(mydefaults_command, 3*PATH_MAX, "%s mysqld server mysqld_safe safe_mysqld", mydefaults);
+  }
 	// gather defaults
-	if((fp = fopen(defaults_file, "r")) != NULL)
+	if((fp = popen(mydefaults_command, "r")) != NULL)
 	{
 	  while(fgets(line, PATH_MAX, fp))
 	  {
       char *p;
       
       // remove end-of-line character
-      if ((p = strrchr(line, '\n')) != NULL) *p = '\0';
+      if ((p = strrchr(line, '\n')) != NULL) 
+        *p = '\0';
       
       // add the option as an argument
 	    add_arg(pal, line);
 	  }
-	  
-	  fclose(fp);
+	  pclose(fp);
 	}
-	
-	// remove file
-	remove(defaults_file);
 }
 
 /******************************************************************************
Thread
bk commit into 4.0 tree (pkarthick:1.2161)pkarthick25 Jan