Changeset 13714 for trunk/libtransmission/platform.c
- Timestamp:
- Dec 29, 2012, 1:47:44 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r13705 r13714 14 14 #include <sys/types.h> /* types needed by quota.h */ 15 15 #include <sys/quota.h> /* quotactl */ 16 #ifdef __FreeBSD__ 17 #include <ufs/ufs/quota.h> /* quotactl() */ 18 #else 19 #include <sys/quota.h> /* quotactl() */ 20 #endif 16 21 #ifdef HAVE_GETMNTENT 17 22 #include <mntent.h> … … 829 834 int64_t limit; 830 835 int64_t freespace; 831 832 if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), device, getuid(), (caddr_t) & dq) == 0) 836 int64_t spaceused; 837 838 #if defined(__FreeBSD__) || defined(SYS_DARWIN) 839 if (quotactl(device, QCMD(Q_GETQUOTA, USRQUOTA), getuid(), &dq) == 0) 840 #else 841 if (quotactl(QCMD(Q_GETQUOTA, USRQUOTA), device, getuid(), (caddr_t) &dq) == 0) 842 #endif 833 843 { 834 844 if (dq.dqb_bsoftlimit > 0) … … 846 856 return -1; 847 857 } 848 849 freespace = limit - btodb(dq.dqb_curspace); 858 #if defined(__FreeBSD__) || defined(SYS_DARWIN) 859 spaceused = (int64_t) dqb_curblocks >> 1; 860 #else 861 spaceused = btodb(dq.dqb_curspace); 862 #endif 863 freespace = limit - spaceused; 850 864 return (freespace < 0) ? 0 : freespace * 1024; 851 865 }
Note: See TracChangeset
for help on using the changeset viewer.