From: Jordan Lee Date: Fri, 4 Jan 2013 02:13:10 +0000 (+0000) Subject: (libT) #3833: 0001-In-OS-X-disk-quota-s-info-already-in-bytes.patch -- patch by taem X-Git-Tag: 2.80~304 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bf21041413618e0480857fefa4c63eaa242d8dc;p=transmission (libT) #3833: 0001-In-OS-X-disk-quota-s-info-already-in-bytes.patch -- patch by taem --- diff --git a/libtransmission/platform.c b/libtransmission/platform.c index 337ee5a00..98d38baf5 100644 --- a/libtransmission/platform.c +++ b/libtransmission/platform.c @@ -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 */