| 78 | } |
| 79 | |
| 80 | DAV_DECLARE(dav_error*) dav_join_error(dav_error *dest, dav_error *src) |
| 81 | { |
| 82 | dav_error *curr = dest; |
| 83 | |
| 84 | /* src error doesn't exist so nothing to join just return dest */ |
| 85 | if (src == NULL) { |
| 86 | return dest; |
| 87 | } |
| 88 | |
| 89 | /* dest error doesn't exist so nothing to join just return src */ |
| 90 | if (curr == NULL) { |
| 91 | return src; |
| 92 | } |
| 93 | |
| 94 | /* find last error in dest stack */ |
| 95 | while (curr->prev != NULL) { |
| 96 | curr = curr->prev; |
| 97 | } |
| 98 | |
| 99 | /* add the src error onto end of dest stack and return it */ |
| 100 | curr->prev = src; |
| 101 | return dest; |
| 102 | } |
| 103 | |
| 104 | /* ### Unclear if this was designed to be used with an uninitialized |
| 105 | * dav_buffer struct, but is used on by dav_lock_get_activelock(). |
no outgoing calls
no test coverage detected