mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
* Debugging for MacOSX, print out NET_RESET stuff.
* Fix discspace for OSX. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3012 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
fa05813283
commit
0b31b54be3
2 changed files with 56 additions and 11 deletions
|
@ -81,19 +81,29 @@ bool RsDiscSpace::crossSystemDiskStats(const char *file, uint64_t& free_blocks,
|
|||
|
||||
free_blocks = dwFreeClusters ;
|
||||
block_size = dwSectorPerCluster * dwBytesPerSector ;
|
||||
#else
|
||||
#ifdef __APPLE__
|
||||
struct statvfs buf;
|
||||
|
||||
if (0 != statvfs (file, &buf))
|
||||
{
|
||||
std::cerr << "Size estimate failed for file " << file << std::endl ;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
free_blocks = buf.f_bavail;
|
||||
block_size = buf.f_frsize ;
|
||||
#else
|
||||
struct statvfs64 buf;
|
||||
|
||||
|
||||
if (0 != statvfs64 (file, &buf))
|
||||
{
|
||||
std::cerr << "Size estimate failed for file " << file << std::endl ;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
free_blocks = buf.f_bavail;
|
||||
block_size = buf.f_frsize ;
|
||||
#else
|
||||
|
||||
|
||||
free_blocks = buf.f_bavail;
|
||||
block_size = buf.f_bsize ;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue