Skip to content

Commit

Permalink
core: pv - use active values for pv buffer slots and size
Browse files Browse the repository at this point in the history
- during startup, param value and active can be different, up to the
moment when the config is completely loaded

(cherry picked from commit a156c62)
(cherry picked from commit 3929986)
(cherry picked from commit 2ad024f)
  • Loading branch information
miconda committed Feb 22, 2018
1 parent 5b5ea4a commit fcbdfdd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pvapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,8 @@ char* pv_get_buffer(void)
char *p;

p = _pv_print_buffer[_pv_print_buffer_index];
_pv_print_buffer_index = (_pv_print_buffer_index+1)%_pv_print_buffer_slots;
_pv_print_buffer_index = (_pv_print_buffer_index+1)
% _pv_print_buffer_slots_active;

return p;
}
Expand All @@ -2044,15 +2045,15 @@ char* pv_get_buffer(void)
*/
int pv_get_buffer_size(void)
{
return _pv_print_buffer_size;
return _pv_print_buffer_size_active;
}

/**
*
*/
int pv_get_buffer_slots(void)
{
return _pv_print_buffer_slots;
return _pv_print_buffer_slots_active;
}

/**
Expand Down

0 comments on commit fcbdfdd

Please sign in to comment.