AVLs: Made an error message more informative

This commit is contained in:
Celine Mercier
2020-04-29 10:14:04 +02:00
parent 974528b2e6
commit e6b6c6fa84
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
major = 3
minor = 0
serial= '0-beta15'
serial= '0-beta15a'
version ="%d.%02d.%s" % (major,minor,serial)

View File

@ -648,7 +648,7 @@ int truncate_avl_data_to_size_used(OBIDMS_avl_data_p avl_data) // TODO is it nec
new_data_size = ((index_t) multiple) * getpagesize();
// Check that it is actually greater than the current size of the file, otherwise no need to truncate
if ((avl_data->header)->data_size_max == new_data_size)
if ((avl_data->header)->data_size_max >= new_data_size)
return 0;
// Get the file descriptor
@ -667,7 +667,7 @@ int truncate_avl_data_to_size_used(OBIDMS_avl_data_p avl_data) // TODO is it nec
if (ftruncate(file_descriptor, file_size) < 0)
{
obi_set_errno(OBI_AVL_ERROR);
obidebug(1, "\nError truncating an AVL data file");
obidebug(1, "\nError truncating an AVL data file, old data size = %lld, new data size = %lld", (avl_data->header)->data_size_max, new_data_size);
return -1;
}