Bug fixes found from using these functions in edquota.

This commit is contained in:
Kirk McKusick 2009-02-10 08:11:44 +00:00
parent cdab8b664d
commit 581fce8e7d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/quota64/; revision=188434
2 changed files with 4 additions and 4 deletions

View File

@ -45,9 +45,9 @@
.Ft "struct quotafile *"
.Fn quota_create "const char *path"
.Ft int
.Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int type"
.Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int id"
.Ft int
.Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int type"
.Fn quota_write "struct quotafile *qf" "const struct dqblk *dqb" "int id"
.Ft int
.Fn quota_close "struct quotafile *qf"
.Sh DESCRIPTION

View File

@ -231,7 +231,7 @@ quota_write32(struct quotafile *qf, const struct dqblk *dqb, int id)
off = id * sizeof(struct dqblk32);
if (lseek(qf->fd, off, SEEK_SET) == -1)
return (-1);
return (write(qf->fd, &dqb32, sizeof(dqb32)));
return (write(qf->fd, &dqb32, sizeof(dqb32)) == -1);
}
static int
@ -252,7 +252,7 @@ quota_write64(struct quotafile *qf, const struct dqblk *dqb, int id)
off = sizeof(struct dqhdr64) + id * sizeof(struct dqblk64);
if (lseek(qf->fd, off, SEEK_SET) == -1)
return (-1);
return (write(qf->fd, &dqb64, sizeof(dqb64)));
return (write(qf->fd, &dqb64, sizeof(dqb64)) == -1);
}
int