The four different loop functions must set the return value in
their private struct because these functions are called from
within the osl library which will replace any negative return value
by -E_OSL_LOOP.
err:
gsi->ret = ret;
gsi->osl_errno = (ret == -E_OSL)? osl_errno : 0;
- return -1;
+ return ret;
}
static int print_global_summary(struct format_info *fi)
err:
usi->ret = ret;
usi->osl_errno = (ret == -E_OSL)? osl_errno : 0;
- return -1;
+ return ret;
}
static int compute_user_summary(struct user_info *ui, __a_unused void *data)
free(dirname);
ret = output("%s", buf);
free(buf);
+ if (ret < 0)
+ goto err;
uli->count--;
return ret;
err:
uli->ret = ret;
uli->osl_errno = (ret == -E_OSL)? osl_errno : 0;
- return -1;
+ return ret;
}
static int print_user_list(struct user_info *ui, void *data)
free(dirname);
ret = output("%s", buf);
free(buf);
+ if (ret < 0)
+ goto err;
if (gli->count > 0)
gli->count--;
return ret;