Changeset View
Changeset View
Standalone View
Standalone View
lib/libnv/nvlist.c
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | while ((nvp = nvlist_first_nvpair(nvl)) != NULL) { | ||||
nvpair_free(nvp); | nvpair_free(nvp); | ||||
} | } | ||||
nvl->nvl_magic = 0; | nvl->nvl_magic = 0; | ||||
free(nvl); | free(nvl); | ||||
errno = serrno; | errno = serrno; | ||||
} | } | ||||
void | |||||
nvlist_set_error(nvlist_t *nvl, int error) | |||||
{ | |||||
if (nvl != NULL && error != 0 && nvl->nvl_error == 0) | |||||
pjd: I'd assert that error is != 0. | |||||
nvl->nvl_error = error; | |||||
} | |||||
int | int | ||||
nvlist_error(const nvlist_t *nvl) | nvlist_error(const nvlist_t *nvl) | ||||
{ | { | ||||
if (nvl == NULL) | if (nvl == NULL) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
NVLIST_ASSERT(nvl); | NVLIST_ASSERT(nvl); | ||||
▲ Show 20 Lines • Show All 1,729 Lines • Show Last 20 Lines |
I'd assert that error is != 0.