diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2008-05-26 11:07:21 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2008-05-26 11:07:21 -0700 |
commit | ddb55e1039f89df52fccbcc554218b8744b3deeb (patch) | |
tree | d6c9453e7590ec6908c6bf3ba5aecc6418b2b4c8 /test | |
parent | d88f7651c7a4673d7a47a0aa86ab0d2ba12a7378 (diff) |
recurse_deps: Return NULL on errors, empty list is not error
The recurse_deps functions are now consistent in returning errors. Since
there are valid cases where an empty list may be returned, an error is
only indicated by returning NULL. This means callers of recurse_deps
must check that the list is not empty before iterating the members.
Diffstat (limited to 'test')
-rw-r--r-- | test/tadd-deps1.c | 2 | ||||
-rw-r--r-- | test/tadd-deps2.c | 2 | ||||
-rw-r--r-- | test/tinstall.c | 2 | ||||
-rw-r--r-- | test/trem-deps.c | 2 | ||||
-rw-r--r-- | test/tremove.c | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/test/tadd-deps1.c b/test/tadd-deps1.c index f872a5d..570f345 100644 --- a/test/tadd-deps1.c +++ b/test/tadd-deps1.c @@ -97,7 +97,7 @@ static void print_sk_list(const initd_list_t *list, initd_sk_t sk) startstop = ""; } - if (list) { + if (list && list->first) { printf("All deps for %s\n", startstop); printf("Ordered:"); for (ip = list->first; ip; ip = ip->next) diff --git a/test/tadd-deps2.c b/test/tadd-deps2.c index 300d1e3..846f385 100644 --- a/test/tadd-deps2.c +++ b/test/tadd-deps2.c @@ -60,7 +60,7 @@ static void print_sk_list(const initd_list_t *list, initd_sk_t sk) startstop = ""; } - if (list) { + if (list && list->first) { printf("All deps for %s\n", startstop); printf("Ordered:"); for (ip = list->first; ip; ip = ip->next) diff --git a/test/tinstall.c b/test/tinstall.c index 21a458a..ff661d6 100644 --- a/test/tinstall.c +++ b/test/tinstall.c @@ -66,7 +66,7 @@ static void print_sk_list(const initd_list_t *list, initd_sk_t sk) startstop = ""; } - if (list) { + if (list && list->first) { printf("All deps for %s\n", startstop); printf("Ordered:"); for (ip = list->first; ip; ip = ip->next) diff --git a/test/trem-deps.c b/test/trem-deps.c index 127d0be..e6501d7 100644 --- a/test/trem-deps.c +++ b/test/trem-deps.c @@ -67,7 +67,7 @@ static void print_sk_list(const initd_list_t *list, initd_sk_t sk) startstop = ""; } - if (list) { + if (list && list->first) { printf("All deps for %s after removal\n", startstop); printf("Ordered:"); for (ip = list->first; ip; ip = ip->next) diff --git a/test/tremove.c b/test/tremove.c index 18c1963..106fe6c 100644 --- a/test/tremove.c +++ b/test/tremove.c @@ -66,7 +66,7 @@ static void print_sk_list(const initd_list_t *list, initd_sk_t sk) startstop = ""; } - if (list) { + if (list && list->first) { printf("All deps for %s\n", startstop); printf("Ordered:"); for (ip = list->first; ip; ip = ip->next) |