List:Internals« Previous MessageNext Message »
From:pkarthick Date:November 30 2005 9:02am
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 05/11/30 13:32:05 pkarthick@stripped +1 -0
  NetWare specific change to make mutiple mysqld_safe instances work when called in quick
successions through a NCF file.

  netware/mysqld_safe.c
    1.9 05/11/30 13:32:04 pkarthick@stripped +15 -27
    NetWare specific change to make mutiple mysqld_safe instances work when called in
quick successions through a NCF file.

# 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/bk/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:04 +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)pkarthick30 Nov