Changeset 13698 for trunk/libtransmission/platform.c
- Timestamp:
- Dec 27, 2012, 7:45:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/platform.c
r13697 r13698 889 889 890 890 static int64_t 891 tr_getQuotaFreeSpace( const char * path )891 tr_getQuotaFreeSpace( const char * path, char * device, char * fstype ) 892 892 { 893 893 int64_t ret=-1; 894 894 #ifndef WIN32 895 char *d, *device; 896 char *fstype; 897 898 if ((d = getblkdev(path)) == NULL) 899 { 900 return ret; 901 } 902 /* 'd' points to static area of memory, so copy it */ 903 device = tr_strdup(d); 904 905 fstype = getfstype(device); 906 if (fstype != NULL && strcasecmp(fstype, "xfs") == 0) 895 char *d; 896 char *fs; 897 898 if (strlen(device) == 0) 899 { 900 if ((d = getblkdev(path)) == NULL) 901 { 902 return ret; 903 } 904 /* Save device for future use */ 905 tr_strlcpy(device, d, PATH_MAX + 1); 906 } 907 908 if (strlen(fstype) == 0) 909 { 910 if ((fs = getfstype(device)) != NULL) 911 { 912 /* Save FS type for future use */ 913 tr_strlcpy(fstype, fs, PATH_MAX + 1); 914 } 915 } 916 917 if (strcasecmp(fstype, "xfs") == 0) 907 918 { 908 919 #ifdef HAVE_XQM … … 913 924 } 914 925 915 tr_free(device);916 926 #endif /* WIN32 */ 917 927 return ret; … … 936 946 937 947 int64_t 938 tr_getFreeSpace( const char * path )939 { 940 int64_t i = tr_getQuotaFreeSpace( path );948 tr_getFreeSpace( const char * path, char * device, char * fstype ) 949 { 950 int64_t i = tr_getQuotaFreeSpace( path, device, fstype ); 941 951 if( i < 0 ) 942 952 i = tr_getDiskFreeSpace( path );
Note: See TracChangeset
for help on using the changeset viewer.