2a61ab9302859c5df98657344c18eb40bcd5cab2
galt
  Thu Aug 6 00:39:03 2015 -0700
allow hgsql to use HGDB_PROF env setting to override default profile

diff --git src/hg/lib/sqlProg.c src/hg/lib/sqlProg.c
index b2644e8..0868ca3 100644
--- src/hg/lib/sqlProg.c
+++ src/hg/lib/sqlProg.c
@@ -140,31 +140,31 @@
     errAbort("profile %s not found in sqlProfileToMyCnf() -- failed for file %s failed with errno %d", profile, defaultFileName, errno);
 if (write (fileNo, settings, strlen(settings)) == -1)
     errAbort("Writing profile %s settings=[%s] as my.cnf format failed for file %s failed with errno %d", profile, settings, defaultFileName, errno);
 
 
 return fileNo;
 }
 
 
 void sqlExecProg(char *prog, char **progArgs, int userArgc, char *userArgv[])
 /* Exec one of the sql programs using user and password from ~/.hg.conf.
  * progArgs is NULL-terminate array of program-specific arguments to add,
  * which maybe NULL. userArgv are arguments passed in from the command line.
  * The program is execvp-ed, this function does not return. */
 {
-sqlExecProgProfile("db", prog, progArgs, userArgc, userArgv);
+sqlExecProgProfile(getDefaultProfileName(), prog, progArgs, userArgc, userArgv);
 }
 
 
 void sqlExecProgLocal(char *prog, char **progArgs, int userArgc, char *userArgv[])
 /* 
  * Exec one of the sql programs using user and password defined in localDb.XXX variables from ~/.hg.conf 
  * progArgs is NULL-terminate array of program-specific arguments to add,
  * which maybe NULL. userArgv are arguments passed in from the command line.
  * The program is execvp-ed, this function does not return. 
  */
 {
 sqlExecProgProfile("localDb", prog, progArgs, userArgc, userArgv);
 }