Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2009 08:11:44 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r188434 - projects/quota64/lib/libutil
Message-ID:  <200902100811.n1A8Bigw085658@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Tue Feb 10 08:11:44 2009
New Revision: 188434
URL: http://svn.freebsd.org/changeset/base/188434

Log:
  Bug fixes found from using these functions in edquota.

Modified:
  projects/quota64/lib/libutil/quotafile.3
  projects/quota64/lib/libutil/quotafile.c

Modified: projects/quota64/lib/libutil/quotafile.3
==============================================================================
--- projects/quota64/lib/libutil/quotafile.3	Tue Feb 10 08:10:57 2009	(r188433)
+++ projects/quota64/lib/libutil/quotafile.3	Tue Feb 10 08:11:44 2009	(r188434)
@@ -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

Modified: projects/quota64/lib/libutil/quotafile.c
==============================================================================
--- projects/quota64/lib/libutil/quotafile.c	Tue Feb 10 08:10:57 2009	(r188433)
+++ projects/quota64/lib/libutil/quotafile.c	Tue Feb 10 08:11:44 2009	(r188434)
@@ -231,7 +231,7 @@ quota_write32(struct quotafile *qf, cons
 	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, cons
 	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902100811.n1A8Bigw085658>