Permalink
Browse files

CLOCK_MONOTONIC, memleak fix.

* Changed clock to CLOCK_MONOTONIC which is suitable for concurrent threads.
* Fixed memory leak in bdev_close.
  • Loading branch information...
Alex Dzyoba
Alex Dzyoba committed Mar 24, 2014
1 parent 24c0a11 commit f86fa71c45c3a59ced99b74b44a30cb8d94ba72d
Showing with 6 additions and 1 deletion.
  1. +2 −0 .gitignore
  2. +4 −1 block_hasher.c
@@ -0,0 +1,2 @@
block_hasher
digest.out
@@ -60,7 +60,7 @@
}
#define get_clock( t ) \
err = clock_gettime( CLOCK_REALTIME, t );\
err = clock_gettime( CLOCK_MONOTONIC, t );\
if( err )\
{\
perror("clock_gettime");\
@@ -240,6 +240,9 @@ void bdev_close( struct block_device *dev )
perror("close");
}
free(dev);
dev = NULL;
return;
}

0 comments on commit f86fa71

Please sign in to comment.