Page MenuHomeFreeBSD

D18785.id52674.diff
No OneTemporary

D18785.id52674.diff

Index: lib/libutil/quotafile.c
===================================================================
--- lib/libutil/quotafile.c
+++ lib/libutil/quotafile.c
@@ -119,6 +119,7 @@
struct group *grp;
struct stat st;
int qcmd, serrno;
+ int ufs;
if ((qf = calloc(1, sizeof(*qf))) == NULL)
return (NULL);
@@ -129,15 +130,21 @@
goto error;
qf->dev = st.st_dev;
qcmd = QCMD(Q_GETQUOTASIZE, quotatype);
+ ufs = strcmp(fs->fs_vfstype, "ufs") == 0;
+ /*
+ * On UFS, hasquota() fills in qf->qfname. But we only care about
+ * this for UFS. So we need to call hasquota() for UFS, first.
+ */
+ if (ufs) {
+ serrno = hasquota(fs, quotatype, qf->qfname,
+ sizeof(qf->qfname));
+ }
if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0)
return (qf);
- /* We only check the quota file for ufs */
- if (strcmp(fs->fs_vfstype, "ufs")) {
+ if (!ufs) {
errno = 0;
goto error;
- }
- serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname));
- if (serrno == 0) {
+ } else if (serrno == 0) {
errno = EOPNOTSUPP;
goto error;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 11:17 PM (7 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14830076
Default Alt Text
D18785.id52674.diff (1 KB)

Event Timeline