h = ec_murmurhash3(key, strlen(key), ec_keyval_seed);
LIST_FOREACH(ref, &keyval->table[h & mask], next) {
- if (strcmp(ref->elt->key, key) == 0) {
- errno = 0;
+ if (strcmp(ref->elt->key, key) == 0)
return ref;
- }
}
errno = ENOENT;
int ec_log_fct_register(ec_log_t usr_log, void *opaque)
{
- errno = 0;
-
if (usr_log == NULL) {
ec_log_fct = ec_log_default_cb;
ec_log_opaque = NULL;
bname_len = strlen(bname);
while (1) {
+ int save_errno = errno;
+
errno = 0;
de = node->readdir(dir);
if (de == NULL) {
- if (errno == 0)
+ if (errno == 0) {
+ errno = save_errno;
goto out;
- else
+ } else {
goto fail;
+ }
}
if (!ec_str_startswith(de->d_name, bname))
int64_t *val)
{
char *endptr;
+ int save_errno = errno;
errno = 0;
*val = strtoll(str, &endptr, node->base);
return -1;
}
+ errno = save_errno;
return 0;
}
uint64_t *val)
{
char *endptr;
+ int save_errno = errno;
/* since a negative input is silently converted to a positive
* one by strtoull(), first check that it is positive */
if (*endptr != 0)
return -1;
+ errno = save_errno;
return 0;
}