Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] Re: Problem with large drives?
Ulrich Petri wrote:
>
> Ulrich Petri wrote:
>
> > Klaus Schmidinger wrote:
> > >
> > > > > Klaus
> > > >
> > > > Any news on this one? I'd like to fix this for version
> > > 1.0.2 if necessary.
> > > >
> > > > Klaus
> > >
> > > Coud the original poster of this problem report please try
> > > the suggested
> > > modifications and let me know what happens?
> > >
> > > Klaus
> >
> > That was me, i'm right at it.
> >
>
> Indeed the modification seems to fix the crash, but i have the feeling
> the size calculating isn't correct anymore:
>
> Without the mounted drive i have the following disks:
> /dev/hdb3 2893660 1036568 1710100 38% /video0
> /dev/hda1 10536328 5124288 5412040 49% /video1
> /dev/hdc1 26759200 22536960 4222240 85% /video2
>
> Which is shown as 71% 7:35 free
>
> When i add the mounted drive:
> /dev/hdb3 2893660 1036568 1710100 38% /video0
> /dev/hda1 10536328 5124288 5412040 49% /video1
> /dev/hdc1 26759200 22536960 4222240 85% /video2
> //192.168.0.1/vdr 120092672 108673024 11419648 91% /video3
>
> It displays 86% 10:28 free.
>
> This cannot be right since ia dded over 10GB which should be something
> about 8h added free time.
>
> Right or am i missing something?
Please try the following patch to tools.c:
--- tools.c 2002/03/31 20:51:06 1.62
+++ tools.c 2002/05/01 16:17:17
@@ -251,10 +251,10 @@
int Free = 0;
struct statfs statFs;
if (statfs(Directory, &statFs) == 0) {
- int blocksPerMeg = 1024 * 1024 / statFs.f_bsize;
+ double blocksPerMeg = 1024.0 * 1024.0 / statFs.f_bsize;
if (UsedMB)
- *UsedMB = (statFs.f_blocks - statFs.f_bfree) / blocksPerMeg;
- Free = statFs.f_bavail / blocksPerMeg;
+ *UsedMB = int((statFs.f_blocks - statFs.f_bfree) / blocksPerMeg);
+ Free = int(statFs.f_bavail / blocksPerMeg);
}
else
LOG_ERROR_STR(Directory);
Klaus
--
_______________________________________________________________
Klaus Schmidinger Phone: +49-8635-6989-10
CadSoft Computer GmbH Fax: +49-8635-6989-40
Hofmark 2 Email: kls@cadsoft.de
D-84568 Pleiskirchen, Germany URL: www.cadsoft.de
_______________________________________________________________
Home |
Main Index |
Thread Index