1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

coverity: add some initilizers

Coverity cannot do a deeper analyzis so let's make just reports
go away and initialize them to 0.
This commit is contained in:
Zdenek Kabelac 2017-11-07 20:54:51 +01:00
parent 3076a839a5
commit 0c9e3e8df2
5 changed files with 10 additions and 9 deletions

View File

@ -865,6 +865,7 @@ static int _event_wait(struct thread_status *thread)
* This is so that you can break out of waiting on an event,
* either for a timeout event, or to cancel the thread.
*/
sigemptyset(&old);
sigemptyset(&set);
sigaddset(&set, SIGALRM);
if (pthread_sigmask(SIG_UNBLOCK, &set, &old) != 0) {

View File

@ -1787,7 +1787,7 @@ struct pool_cb_data {
static int _pool_callback(struct dm_tree_node *node,
dm_node_callback_t type, void *cb_data)
{
int ret, status, fd;
int ret, status = 0, fd;
const struct dm_config_node *cn;
const struct dm_config_value *cv;
const struct pool_cb_data *data = cb_data;

View File

@ -2626,7 +2626,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft,
"for selection field %s.";
struct selection_str_list *ssl = NULL;
struct dm_str_list *item;
const char *begin_item, *end_item, *tmp;
const char *begin_item = NULL, *end_item = NULL, *tmp;
uint32_t op_flags, end_op_flag_expected, end_op_flag_hit = 0;
struct dm_str_list **arr;
size_t list_size;

View File

@ -1158,10 +1158,10 @@ static int _lvconvert_mirrors(struct cmd_context *cmd,
struct logical_volume *lv,
struct lvconvert_params *lp)
{
uint32_t old_mimage_count;
uint32_t old_log_count;
uint32_t new_mimage_count;
uint32_t new_log_count;
uint32_t old_mimage_count = 0;
uint32_t old_log_count = 0;
uint32_t new_mimage_count = 0;
uint32_t new_log_count = 0;
if ((lp->corelog || lp->mirrorlog) && *lp->type_str && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) {
log_error("--corelog and --mirrorlog are only compatible with mirror devices.");

View File

@ -2723,9 +2723,9 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv)
char buf[64];
struct cmd_rule *rule;
struct lv_type *lvtype = NULL;
uint64_t lv_props_match_bits, lv_props_unmatch_bits;
uint64_t lv_types_match_bits, lv_types_unmatch_bits;
int opts_match_count, opts_unmatch_count;
uint64_t lv_props_match_bits = 0, lv_props_unmatch_bits = 0;
uint64_t lv_types_match_bits = 0, lv_types_unmatch_bits = 0;
int opts_match_count = 0, opts_unmatch_count = 0;
int lvt_enum;
int ret = 1;
int i;