]> granicus.if.org Git - transmission/commitdiff
Fixed platform-quota.c for DragonFly. The patch is taken from dports.
authorAleksej Lebedev <root@zta.lk>
Mon, 19 Jun 2017 10:45:09 +0000 (12:45 +0200)
committerMike Gelfand <mikedld@mikedld.com>
Mon, 19 Jun 2017 16:27:05 +0000 (19:27 +0300)
libtransmission/platform-quota.c

index f1c4390033b4590aec97dca5b2b90e503f0d3a19..364714ab76733d2911e0e22bc69c43a768bbf8b7 100644 (file)
@@ -17,6 +17,8 @@
 #include <sys/types.h> /* types needed by quota.h */
 #if defined(__FreeBSD__) || defined(__OpenBSD__)
 #include <ufs/ufs/quota.h> /* quotactl() */
+#elif defined(__DragonFly__)
+#include <vfs/ufs/quota.h> /* quotactl */
 #elif defined(__NetBSD__)
 #include <sys/param.h>
 #ifndef statfs
@@ -313,12 +315,16 @@ static int64_t getquota(char const* device)
 
 static int64_t getquota(char const* device)
 {
+#if defined(__DragonFly__)
+    struct ufs_dqblk dq;
+#else
     struct dqblk dq;
+#endif
     int64_t limit;
     int64_t freespace;
     int64_t spaceused;
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__)
 
     if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), (caddr_t)&dq) == 0)
     {
@@ -363,7 +369,7 @@ static int64_t getquota(char const* device)
             return -1;
         }
 
-#if defined(__FreeBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
         spaceused = (int64_t)dq.dqb_curblocks >> 1;
 #elif defined(__APPLE__)
         spaceused = (int64_t)dq.dqb_curbytes;