Test for quota support the same way the user tools do.
authorfsgqa <fsgqa>
Tue, 12 Nov 2002 09:34:57 +0000 (09:34 +0000)
committerfsgqa <fsgqa>
Tue, 12 Nov 2002 09:34:57 +0000 (09:34 +0000)
src/feature.c

index 5c5998bfc21dd804e296fab43a69e4e5b7296e34..9e9ade6b133a096ccefabcde62209f1f8d483c14 100644 (file)
@@ -140,6 +140,9 @@ hasxfsquota(int type, int q, char *device)
        fs_quota_stat_t qstat;
        int             qcmd;
 
+       if (q == 0)
+               return (access("/proc/fs/xfs/xqm", F_OK) < 0);
+
        memset(&qstat, 0, sizeof(fs_quota_stat_t));
        qcmd = QCMD(Q_XGETQSTAT, type);
        if (quotactl(qcmd, device, 0, (caddr_t)&qstat) < 0) {
@@ -147,8 +150,6 @@ hasxfsquota(int type, int q, char *device)
                        perror("quotactl");
                return (1);
        }
-       else if (q == 0)
-               return (0);
        else if (q == XFS_QUOTA_UDQ_ENFD && qstat.qs_flags & XFS_QUOTA_UDQ_ENFD)
                return (0);
        else if (q == XFS_QUOTA_GDQ_ENFD && qstat.qs_flags & XFS_QUOTA_GDQ_ENFD)