openbsd-ports/audio/libgpod/patches/patch-src_itdb_itunesdb_c
2007-11-22 22:37:33 +00:00

30 lines
906 B
Plaintext

$OpenBSD: patch-src_itdb_itunesdb_c,v 1.5 2007/11/22 22:37:33 ckuethe Exp $
--- src/itdb_itunesdb.c.orig Tue Nov 6 11:55:57 2007
+++ src/itdb_itunesdb.c Sun Nov 18 00:21:47 2007
@@ -119,7 +119,6 @@
#include <glib/gstdio.h>
#include <stdio.h>
#include <string.h>
-#include <sys/statvfs.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
@@ -6729,14 +6728,14 @@ static gboolean itdb_create_directories (Itdb_Device *
dirnum = info->musicdirs;
if (dirnum == 0)
{ /* do a guess */
- struct statvfs stat;
- if (statvfs (mp, &stat) != 0)
+ struct stat sb;
+ if (stat (mp, &sb) != 0)
{ /* why should this fail !? */
dirnum = 20;
}
else
{
- gdouble size = ((gdouble)stat.f_blocks * stat.f_frsize) / 1073741824;
+ gdouble size = ((gdouble)sb.st_blocks * sb.st_size) / 1073741824;
if (size < 20) dirnum = 20;
else dirnum = 50;
}