projects
/
collection4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
593828e
)
src/graph_def.c: Add error messages to "def_create".
author
Florian Forster
<ff@octo.it>
Wed, 14 Jul 2010 15:56:36 +0000
(17:56 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Wed, 14 Jul 2010 15:56:36 +0000
(17:56 +0200)
src/graph_def.c
patch
|
blob
|
history
diff --git
a/src/graph_def.c
b/src/graph_def.c
index
9aba1ce
..
e7effec
100644
(file)
--- a/
src/graph_def.c
+++ b/
src/graph_def.c
@@
-158,15
+158,22
@@
graph_def_t *def_create (graph_config_t *cfg, graph_ident_t *ident, /* {{{ */
graph_def_t *ret;
if ((cfg == NULL) || (ident == NULL) || (ds_name == NULL))
graph_def_t *ret;
if ((cfg == NULL) || (ident == NULL) || (ds_name == NULL))
+ {
+ fprintf (stderr, "def_create: An argument is NULL\n");
return (NULL);
return (NULL);
+ }
selector = graph_get_selector (cfg);
if (selector == NULL)
selector = graph_get_selector (cfg);
if (selector == NULL)
+ {
+ fprintf (stderr, "def_create: graph_get_selector failed\n");
return (NULL);
return (NULL);
+ }
ret = malloc (sizeof (*ret));
if (ret == NULL)
{
ret = malloc (sizeof (*ret));
if (ret == NULL)
{
+ fprintf (stderr, "def_create: malloc failed\n");
ident_destroy (selector);
return (NULL);
}
ident_destroy (selector);
return (NULL);
}
@@
-177,6
+184,7
@@
graph_def_t *def_create (graph_config_t *cfg, graph_ident_t *ident, /* {{{ */
ret->ds_name = strdup (ds_name);
if (ret->ds_name == NULL)
{
ret->ds_name = strdup (ds_name);
if (ret->ds_name == NULL)
{
+ fprintf (stderr, "def_create: Unable to copy DS name\n");
ident_destroy (selector);
free (ret);
return (NULL);
ident_destroy (selector);
free (ret);
return (NULL);
@@
-189,6
+197,7
@@
graph_def_t *def_create (graph_config_t *cfg, graph_ident_t *ident, /* {{{ */
IDENT_FLAG_REPLACE_ANY);
if (ret->select == NULL)
{
IDENT_FLAG_REPLACE_ANY);
if (ret->select == NULL)
{
+ fprintf (stderr, "def_create: ident_copy_with_selector failed\n");
ident_destroy (selector);
free (ret->ds_name);
free (ret);
ident_destroy (selector);
free (ret->ds_name);
free (ret);