src/hg/lib/bamFile.c 1.22
1.22 2010/03/04 05:14:13 angie
Pass sql conn into bamFileNameFromTable, so we can get it from hAllocConnTrack, to support use of hg.conf profiles.
Index: src/hg/lib/bamFile.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/lib/bamFile.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -B -U 4 -r1.21 -r1.22
--- src/hg/lib/bamFile.c 3 Mar 2010 19:30:02 -0000 1.21
+++ src/hg/lib/bamFile.c 4 Mar 2010 05:14:13 -0000 1.22
@@ -10,14 +10,13 @@
#include "bamFile.h"
static char const rcsid[] = "$Id$";
-char *bamFileNameFromTable(char *db, char *table, char *bamSeqName)
+char *bamFileNameFromTable(struct sqlConnection *conn, char *table, char *bamSeqName)
/* Return file name from table. If table has a seqName column, then grab the
* row associated with bamSeqName (which is not nec. in chromInfo, e.g.
* bam file might have '1' not 'chr1'). */
{
-struct sqlConnection *conn = hAllocConn(db);
boolean checkSeqName = (sqlFieldIndex(conn, table, "seqName") >= 0);
if (checkSeqName && bamSeqName == NULL)
errAbort("bamFileNameFromTable: table %s has seqName column, but NULL seqName passed in",
table);
@@ -44,9 +43,8 @@
errAbort("Missing fileName for seqName '%s' in %s table", bamSeqName, table);
else
errAbort("Missing fileName in %s table", table);
}
-hFreeConn(&conn);
return fileName;
}
static boolean isRegularFile(char *filename)