Changeset 14259
- Timestamp:
- Apr 27, 2014, 12:02:00 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r14256 r14259 109 109 AC_SEARCH_LIBS([socket], [socket net]) 110 110 AC_SEARCH_LIBS([gethostbyname], [nsl bind]) 111 AC_SEARCH_LIBS([quotacursor_skipidtype], [quota]) 111 112 PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM], , [CHECK_SSL()]) 112 113 PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM]) -
trunk/libtransmission/platform-quota.c
r14241 r14259 18 18 #if defined(__FreeBSD__) || defined(__OpenBSD__) 19 19 #include <ufs/ufs/quota.h> /* quotactl() */ 20 #elif defined (__NetBSD__) 21 #include <sys/param.h> 22 #ifndef statfs 23 #define statfs statvfs 24 #endif 20 25 #elif defined (__sun) 21 26 #include <sys/fs/ufs_quota.h> /* quotactl */ … … 193 198 } 194 199 200 #if defined(__NetBSD__) && (__NetBSD_Version__ >= 600000000) 201 #include <quota.h> 202 203 static int64_t 204 getquota (const char * device) 205 { 206 struct quotahandle *qh; 207 struct quotakey qk; 208 struct quotaval qv; 209 int64_t limit; 210 int64_t freespace; 211 int64_t spaceused; 212 213 qh = quota_open(device); 214 if (qh == NULL) { 215 return -1; 216 } 217 qk.qk_idtype = QUOTA_IDTYPE_USER; 218 qk.qk_id = getuid(); 219 qk.qk_objtype = QUOTA_OBJTYPE_BLOCKS; 220 if (quota_get(qh, &qk, &qv) == -1) { 221 quota_close(qh); 222 return -1; 223 } 224 if (qv.qv_softlimit > 0) { 225 limit = qv.qv_softlimit; 226 } 227 else if (qv.qv_hardlimit > 0) { 228 limit = qv.qv_hardlimit; 229 } 230 else { 231 quota_close(qh); 232 return -1; 233 } 234 spaceused = qv.qv_usage; 235 quota_close(qh); 236 237 freespace = limit - spaceused; 238 return (freespace < 0) ? 0 : freespace; 239 } 240 #else 195 241 static int64_t 196 242 getquota (const char * device) … … 257 303 return -1; 258 304 } 305 #endif 259 306 260 307 #ifdef HAVE_XQM
Note: See TracChangeset
for help on using the changeset viewer.