From 0b0613ced87a9a9028a3ae520fab1d25475104a0 Mon Sep 17 00:00:00 2001
From: Jordan Lee <jordan@transmissionbt.com>
Date: Sat, 29 Dec 2012 12:08:46 +0000
Subject: [PATCH] (trunk, libT) #3833 'freespace rpc'
 0001-Fix-FTBFS-for-OS-X-and-uClibc.patch

---
 libtransmission/platform.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libtransmission/platform.c b/libtransmission/platform.c
index 669540929..2179ee57f 100644
--- a/libtransmission/platform.c
+++ b/libtransmission/platform.c
@@ -836,7 +836,7 @@ getquota (char * device)
   int64_t spaceused;
 
 #if defined(__FreeBSD__) || defined(SYS_DARWIN)
-  if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), &dq) == 0)
+  if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), (caddr_t) &dq) == 0)
 #else
   if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), device, getuid(), (caddr_t) &dq) == 0)
 #endif
@@ -855,8 +855,12 @@ getquota (char * device)
           /* No quota enabled for this user */
           return -1;
         }
-#if defined(__FreeBSD__) || defined(SYS_DARWIN)
-      spaceused = (int64_t) dqb_curblocks >> 1;
+#if defined(__FreeBSD__)
+      spaceused = (int64_t) dq.dqb_curblocks >> 1;
+#elif defined(SYS_DARWIN)
+      spaceused = (int64_t) dq.dqb_curbytes >> 1;
+#elif defined(__UCLIBC__)
+      spaceused = (int64_t) btodb(dq.dqb_curblocks);
 #else
       spaceused = btodb(dq.dqb_curspace);
 #endif
-- 
2.40.0