Code

Merge branch 'collectd-4.3' into collectd-4.4
authorFlorian Forster <sifnfors@informatik.stud.uni-erlangen.de>
Tue, 27 May 2008 11:16:46 +0000 (13:16 +0200)
committerFlorian Forster <sifnfors@informatik.stud.uni-erlangen.de>
Tue, 27 May 2008 11:16:46 +0000 (13:16 +0200)
build.sh
src/liboconfig/oconfig.c
src/utils_llist.c

index 3efb44f64047c5bdeedf6dc5d646230645a4afcd..cede2e48f2fc8cf3725ae04c9928e7862f1dd864 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,5 +1,15 @@
 #! /bin/sh
 
+if ! which lex > /dev/null 2>&1; then
+       echo "WARNING: lex not found!" >&2
+       echo "Make sure that you have a flex compatible tool available." >&2
+fi
+
+if ! which yacc > /dev/null 2>&1; then
+       echo "WARNING: yacc not found!" >&2
+       echo "Make sure that you have a GNU bison compatible tool available." >&2
+fi
+
 libtoolize=libtoolize
 
 if which glibtoolize > /dev/null 2>&1; then
index 8cc3c8abc616b640e0d45a1eb672c60d2d47df1d..79b53aec8825f858c87d4b83682b9b99450496be 100644 (file)
@@ -27,7 +27,7 @@
 extern FILE *yyin;
 
 oconfig_item_t *ci_root;
-char           *c_file;
+const char     *c_file;
 
 static void yyset_in  (FILE *fd)
 {
index 7fae025d62233ca51613268369239c43f516f973..bf5f7e4944e335c6660eb0226cd8d43faa9aa2a8 100644 (file)
@@ -59,6 +59,9 @@ void llist_destroy (llist_t *l)
        llentry_t *e_this;
        llentry_t *e_next;
 
+       if (l == NULL)
+               return;
+
        for (e_this = l->head; e_this != NULL; e_this = e_next)
        {
                e_next = e_this->next;
@@ -140,6 +143,9 @@ llentry_t *llist_search (llist_t *l, const char *key)
 {
        llentry_t *e;
 
+       if (l == NULL)
+               return (NULL);
+
        for (e = l->head; e != NULL; e = e->next)
                if (strcmp (key, e->key) == 0)
                        break;
@@ -149,10 +155,14 @@ llentry_t *llist_search (llist_t *l, const char *key)
 
 llentry_t *llist_head (llist_t *l)
 {
+       if (l == NULL)
+               return (NULL);
        return (l->head);
 }
 
 llentry_t *llist_tail (llist_t *l)
 {
+       if (l == NULL)
+               return (NULL);
        return (l->tail);
 }