mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
Bug fixes found from using these functions in edquota.
This commit is contained in:
parent
cdab8b664d
commit
581fce8e7d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/quota64/; revision=188434
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue