#include <grp.h>
#include "init.h"
#include "quota.h"
+#include "libfrog/logging.h"
#include "libfrog/fsgeom.h"
#include "libfrog/bulkstat.h"
*dp = NULL;
ndu[0] = ndu[1] = ndu[2] = 0;
- ret = xfd_open(&fsxfd, fsdir, O_RDONLY);
+ ret = -xfd_open(&fsxfd, fsdir, O_RDONLY);
if (ret) {
- errno = ret;
- perror(fsdir);
+ xfrog_perror(ret, fsdir);
return;
}
- breq = xfrog_bulkstat_alloc_req(NBSTAT, 0);
- if (!breq) {
- perror("calloc");
+ ret = -xfrog_bulkstat_alloc_req(NBSTAT, 0, &breq);
+ if (ret) {
+ xfrog_perror(ret, "calloc");
xfd_close(&fsxfd);
return;
}
- while ((sts = xfrog_bulkstat(&fsxfd, breq)) == 0) {
+ while ((sts = -xfrog_bulkstat(&fsxfd, breq)) == 0) {
if (breq->hdr.ocount == 0)
break;
for (i = 0; i < breq->hdr.ocount; i++)
quot_bulkstat_add(&breq->bulkstat[i], flags);
}
- if (sts < 0) {
- errno = sts;
- perror("XFS_IOC_FSBULKSTAT");
- }
+ if (sts < 0)
+ xfrog_perror(sts, "XFS_IOC_FSBULKSTAT");
free(breq);
xfd_close(&fsxfd);
}