]> granicus.if.org Git - transmission/commitdiff
(libT) #3833: 0001-In-OS-X-disk-quota-s-info-already-in-bytes.patch -- patch by taem
authorJordan Lee <jordan@transmissionbt.com>
Fri, 4 Jan 2013 02:13:10 +0000 (02:13 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Fri, 4 Jan 2013 02:13:10 +0000 (02:13 +0000)
libtransmission/platform.c

index 337ee5a00b8a1bc081d944a48a3c74d10e6cf4e2..98d38baf5ad81aeec7eacdd88c6e6bd2252f4003 100644 (file)
@@ -856,14 +856,18 @@ getquota (char * device)
 #if defined(__FreeBSD__)
       spaceused = (int64_t) dq.dqb_curblocks >> 1;
 #elif defined(SYS_DARWIN)
-      spaceused = (int64_t) dq.dqb_curbytes >> 1;
+      spaceused = (int64_t) dq.dqb_curbytes;
 #elif defined(__UCLIBC__)
       spaceused = (int64_t) btodb(dq.dqb_curblocks);
 #else
       spaceused = btodb(dq.dqb_curspace);
 #endif
       freespace = limit - spaceused;
+#ifdef SYS_DARWIN
+      return (freespace < 0) ? 0 : freespace;
+#else
       return (freespace < 0) ? 0 : freespace * 1024;
+#endif
     }
 
   /* something went wrong */