AROS has working statfs(), so lets use it for printing the free disk size.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1973 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
mazzearos 2012-08-02 16:02:33 +00:00
parent c68f05cda5
commit 7e7c718d40

View File

@ -38,6 +38,8 @@
#include <mint/sysbind.h>
#include <mint/osbind.h>
#include <mint/ostruct.h>
#elif defined(__AROS__)
#include <sys/mount.h>
#endif
#include "const.h"
@ -786,7 +788,7 @@ void Button_Stats(void)
GetDiskFreeSpaceEx(Main_current_directory,&tailleU,NULL,NULL);
mem_size = tailleU.QuadPart;
}
#elif defined(__linux__) || defined(__macosx__) || defined(__FreeBSD__) || defined(__SYLLABLE__)
#elif defined(__linux__) || defined(__macosx__) || defined(__FreeBSD__) || defined(__SYLLABLE__) || defined(__AROS__)
{
struct statfs disk_info;
statfs(Main_current_directory,&disk_info);
@ -812,10 +814,13 @@ void Button_Stats(void)
// Display free space
if (mem_size != 0)
{
#if defined(__AROS__)
sprintf(buffer,"Free space on %s",Main_current_directory);
#else
sprintf(buffer,"Free space on %c:",Main_current_directory[0]);
#endif
Print_in_window(10,67,buffer,STATS_TITLE_COLOR,MC_Black);
if(mem_size > (100ULL*1024*1024*1024))
sprintf(buffer,"%u Gigabytes",(unsigned int)(mem_size/(1024*1024*1024)));
else if(mem_size > (100*1024*1024))
@ -824,7 +829,11 @@ void Button_Stats(void)
sprintf(buffer,"%u Kilobytes",(unsigned int)(mem_size/1024));
else
sprintf(buffer,"%u bytes",(unsigned int)mem_size);
#if defined(__AROS__)
Print_in_window(192,67,buffer,STATS_DATA_COLOR,MC_Black);
#else
Print_in_window(146,67,buffer,STATS_DATA_COLOR,MC_Black);
#endif
} else {
#ifndef NODISKSPACESUPPORT
Print_in_window(10,67,"Disk full!",STATS_TITLE_COLOR,MC_Black);