summaryrefslogtreecommitdiffstats
path: root/src/server/integrity.c
diff options
context:
space:
mode:
authorSimon Rettberg2014-12-31 23:39:21 +0100
committerSimon Rettberg2014-12-31 23:39:21 +0100
commit6788efa3459b9581b1e4197e37f504d8fb2e8e87 (patch)
treef177c92792884dd98c82b8d8828b092b2119a36c /src/server/integrity.c
parent[SERVER] Minor tweaks and improvements (diff)
downloaddnbd3-6788efa3459b9581b1e4197e37f504d8fb2e8e87.tar.gz
dnbd3-6788efa3459b9581b1e4197e37f504d8fb2e8e87.tar.xz
dnbd3-6788efa3459b9581b1e4197e37f504d8fb2e8e87.zip
[SERVER] Use stdbool.h for booleans; minor refactoring of variable and function names
Diffstat (limited to 'src/server/integrity.c')
-rw-r--r--src/server/integrity.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/integrity.c b/src/server/integrity.c
index 245d394..2911085 100644
--- a/src/server/integrity.c
+++ b/src/server/integrity.c
@@ -29,7 +29,7 @@ static queue_entry checkQueue[CHECK_QUEUE_SIZE];
static pthread_mutex_t integrityQueueLock;
static pthread_cond_t queueSignal;
static volatile int queueLen = -1;
-static volatile int bRunning = FALSE;
+static volatile bool bRunning = false;
static void* integrity_main(void *data);
@@ -41,9 +41,9 @@ void integrity_init()
assert( queueLen == -1 );
pthread_mutex_init( &integrityQueueLock, NULL );
pthread_cond_init( &queueSignal, NULL );
- bRunning = TRUE;
+ bRunning = true;
if ( 0 != thread_create( &thread, NULL, &integrity_main, (void *)NULL ) ) {
- bRunning = FALSE;
+ bRunning = false;
memlogf( "[WARNING] Could not start integrity check thread. Corrupted images will not be detected." );
return;
}
@@ -143,7 +143,7 @@ static void* integrity_main(void *data)
//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 );
+ image_updateCachemap( image, blocks[0] * HASH_BLOCK_SIZE, (blocks[0] + 1) * HASH_BLOCK_SIZE, false );
}
close( fd );
}
@@ -157,6 +157,6 @@ static void* integrity_main(void *data)
}
pthread_mutex_unlock( &integrityQueueLock );
if ( buffer != NULL ) free( buffer );
- bRunning = FALSE;
+ bRunning = false;
return NULL ;
}