From 49f9218d330f5842fe24bce79267bd2c5b239df3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 16 Jun 2014 19:24:17 +0200 Subject: Improve uplink handling, add code to debug thread creation/destruction, change stupid convention of freeDiskSpace returning 0 on error, which is ambiguous to the disk simply being full... --- src/server/integrity.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/integrity.c') diff --git a/src/server/integrity.c b/src/server/integrity.c index 4e637f6..16bc9eb 100644 --- a/src/server/integrity.c +++ b/src/server/integrity.c @@ -42,7 +42,7 @@ void integrity_init() pthread_mutex_init( &integrityQueueLock, NULL ); pthread_cond_init( &queueSignal, NULL ); bRunning = TRUE; - if ( 0 != pthread_create( &thread, NULL, &integrity_main, (void *)NULL ) ) { + if ( 0 != thread_create( &thread, NULL, &integrity_main, (void *)NULL ) ) { bRunning = FALSE; memlogf( "[WARNING] Could not start integrity check thread. Corrupted images will not be detected." ); return; @@ -57,7 +57,7 @@ void integrity_shutdown() pthread_mutex_lock( &integrityQueueLock ); pthread_cond_signal( &queueSignal ); pthread_mutex_unlock( &integrityQueueLock ); - pthread_join( thread, NULL ); + thread_join( thread, NULL ); while ( bRunning ) usleep( 10000 ); pthread_mutex_destroy( &integrityQueueLock ); @@ -135,7 +135,7 @@ static void* integrity_main(void *data) int fd = open( image->path, O_RDONLY ); if ( fd >= 0 ) { if ( image_checkBlocksCrc32( fd, (uint32_t*)buffer, blocks, fileSize ) ) { - printf( "[DEBUG] CRC check of block %d for %s succeeded :-)\n", blocks[0], image->lower_name ); + //printf( "[DEBUG] CRC check of block %d for %s succeeded :-)\n", blocks[0], image->lower_name ); } else { memlogf( "[WARNING] Hash check for block %d of %s failed!", blocks[0], image->lower_name ); image_updateCachemap( image, blocks[0] * HASH_BLOCK_SIZE, (blocks[0] + 1) * HASH_BLOCK_SIZE, FALSE ); -- cgit v1.2.3-55-g7522