diff --git a/libtransmission/platform-quota.c b/libtransmission/platform-quota.c index f1c439003..364714ab7 100644 --- a/libtransmission/platform-quota.c +++ b/libtransmission/platform-quota.c @@ -17,6 +17,8 @@ #include /* types needed by quota.h */ #if defined(__FreeBSD__) || defined(__OpenBSD__) #include /* quotactl() */ +#elif defined(__DragonFly__) +#include /* quotactl */ #elif defined(__NetBSD__) #include #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;