mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Use NULL for pointers
This commit is contained in:
parent
90d106ef19
commit
f45106b726
@ -1,5 +1,6 @@
|
|||||||
Version 1.02.68 -
|
Version 1.02.68 -
|
||||||
==================================
|
==================================
|
||||||
|
Improve libdm-config error path reporting.
|
||||||
Update dmsetup resume man with --addnodeonresume/create options.
|
Update dmsetup resume man with --addnodeonresume/create options.
|
||||||
Add dependency for dm man pages to man subdirectory make target all:.
|
Add dependency for dm man pages to man subdirectory make target all:.
|
||||||
Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.
|
Add dm_tree_retry_remove to use retry logic for device removal in a dm_tree.
|
||||||
|
@ -523,7 +523,7 @@ static struct dm_config_node *_file(struct parser *p)
|
|||||||
struct dm_config_node *root = NULL, *n, *l = NULL;
|
struct dm_config_node *root = NULL, *n, *l = NULL;
|
||||||
while (p->t != TOK_EOF) {
|
while (p->t != TOK_EOF) {
|
||||||
if (!(n = _section(p)))
|
if (!(n = _section(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
|
|
||||||
if (!root)
|
if (!root)
|
||||||
root = n;
|
root = n;
|
||||||
@ -540,10 +540,10 @@ static struct dm_config_node *_section(struct parser *p)
|
|||||||
/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
|
/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
|
||||||
struct dm_config_node *root, *n, *l = NULL;
|
struct dm_config_node *root, *n, *l = NULL;
|
||||||
if (!(root = _create_node(p->mem)))
|
if (!(root = _create_node(p->mem)))
|
||||||
return_0;
|
return_NULL;
|
||||||
|
|
||||||
if (!(root->key = _dup_tok(p)))
|
if (!(root->key = _dup_tok(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
|
|
||||||
match(TOK_IDENTIFIER);
|
match(TOK_IDENTIFIER);
|
||||||
|
|
||||||
@ -551,7 +551,7 @@ static struct dm_config_node *_section(struct parser *p)
|
|||||||
match(TOK_SECTION_B);
|
match(TOK_SECTION_B);
|
||||||
while (p->t != TOK_SECTION_E) {
|
while (p->t != TOK_SECTION_E) {
|
||||||
if (!(n = _section(p)))
|
if (!(n = _section(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
|
|
||||||
if (!root->child)
|
if (!root->child)
|
||||||
root->child = n;
|
root->child = n;
|
||||||
@ -564,7 +564,7 @@ static struct dm_config_node *_section(struct parser *p)
|
|||||||
} else {
|
} else {
|
||||||
match(TOK_EQ);
|
match(TOK_EQ);
|
||||||
if (!(root->v = _value(p)))
|
if (!(root->v = _value(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
@ -578,7 +578,7 @@ static struct dm_config_value *_value(struct parser *p)
|
|||||||
match(TOK_ARRAY_B);
|
match(TOK_ARRAY_B);
|
||||||
while (p->t != TOK_ARRAY_E) {
|
while (p->t != TOK_ARRAY_E) {
|
||||||
if (!(l = _type(p)))
|
if (!(l = _type(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
|
|
||||||
if (!h)
|
if (!h)
|
||||||
h = l;
|
h = l;
|
||||||
@ -595,7 +595,7 @@ static struct dm_config_value *_value(struct parser *p)
|
|||||||
*/
|
*/
|
||||||
if (!h) {
|
if (!h) {
|
||||||
if (!(h = _create_value(p->mem)))
|
if (!(h = _create_value(p->mem)))
|
||||||
return NULL;
|
return_NULL;
|
||||||
|
|
||||||
h->type = DM_CFG_EMPTY_ARRAY;
|
h->type = DM_CFG_EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
@ -633,7 +633,7 @@ static struct dm_config_value *_type(struct parser *p)
|
|||||||
|
|
||||||
p->tb++, p->te--; /* strip "'s */
|
p->tb++, p->te--; /* strip "'s */
|
||||||
if (!(v->v.str = _dup_tok(p)))
|
if (!(v->v.str = _dup_tok(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
p->te++;
|
p->te++;
|
||||||
match(TOK_STRING);
|
match(TOK_STRING);
|
||||||
break;
|
break;
|
||||||
@ -643,7 +643,7 @@ static struct dm_config_value *_type(struct parser *p)
|
|||||||
|
|
||||||
p->tb++, p->te--; /* strip "'s */
|
p->tb++, p->te--; /* strip "'s */
|
||||||
if (!(str = _dup_tok(p)))
|
if (!(str = _dup_tok(p)))
|
||||||
return_0;
|
return_NULL;
|
||||||
dm_unescape_double_quotes(str);
|
dm_unescape_double_quotes(str);
|
||||||
v->v.str = str;
|
v->v.str = str;
|
||||||
p->te++;
|
p->te++;
|
||||||
@ -653,7 +653,7 @@ static struct dm_config_value *_type(struct parser *p)
|
|||||||
default:
|
default:
|
||||||
log_error("Parse error at byte %" PRIptrdiff_t " (line %d): expected a value",
|
log_error("Parse error at byte %" PRIptrdiff_t " (line %d): expected a value",
|
||||||
p->tb - p->fb + 1, p->line);
|
p->tb - p->fb + 1, p->line);
|
||||||
return 0;
|
return NULL;
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user