*
* Email: crh@ubiqx.mn.org
*
- * $Id: PrequelD.c 2012-09-12 17:37:39 -0500 crh$
+ * $Id: PrequelD.c 2012-09-12 18:07:45 -0500 crh$
*
* -------------------------------------------------------------------------- **
*
static const char *Revision =
"$Revision$";
static const char *Id =
- "$Id: PrequelD.c 2012-09-12 17:37:39 -0500 crh$";
+ "$Id: PrequelD.c 2012-09-12 18:07:45 -0500 crh$";
static const char *HelpMsg[] =
{
(void)pthread_mutex_unlock( &GlobalMutex );
return;
}
-
- /* We have mutex and a configuration entry.
- * Copy all of the config values so that we can release the mutex.
+ /* This should be impossible.
+ * Check PD_read_config if this ever happens.
*/
- if( entry->cacheDir )
- {
- cacheDir = strdup( entry->cacheDir );
- minBlocks = entry->minBlocks;
- hashType = entry->v1HashType;
- syserr = 0;
- (void)memcpy( key, entry->userParam, PD_V1_KEY_SIZE );
- }
- else
+ if( NULL == (entry->cacheDir) )
{
- /* This should be impossible.
- * Check PD_read_config if this ever happens.
- */
Log( "Bad configuration entry; cacheDir is NULL.\n" );
(void)pthread_mutex_unlock( &GlobalMutex );
return;
}
+ /* We have mutex and a configuration entry.
+ * Copy all of the config values so that we can release the mutex.
+ */
+ cacheDir = strdup( entry->cacheDir );
+ minBlocks = entry->minBlocks;
+ hashType = entry->v1HashType;
+ syserr = 0;
+ (void)memcpy( key, entry->userParam, PD_V1_KEY_SIZE );
/* Check the <cacheDir> copy. */
if( NULL == cacheDir )
{
if( Verbosity )
Log( "Warning: Memory allocation failure in WorkHash().\n" );
+ (void)pthread_mutex_unlock( &GlobalMutex );
return;
}
* the mutex just now.
*/
(void)pthread_mutex_unlock( &GlobalMutex );
+ /* FIX: If verbosity > 2 save start time & report calc time at end. */
result = pd_v1CreateHashCache( srcPathName,
cacheDir,
minBlocks,