1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
$NetBSD: patch-ab,v 1.2 2004/04/22 15:28:47 drochner Exp $
--- vobcopy.c.orig 2004-03-26 19:53:10.000000000 +0100
+++ vobcopy.c 2004-04-22 15:54:46.000000000 +0200
@@ -63,20 +63,22 @@
#include <fcntl.h>
#include <unistd.h>
#include <dirent.h> /*for readdir*/
-#if (defined(__unix__) || defined(unix)) && !defined(USG) || (defined(__APPLE__) && defined(__GNUC__))
+#if (defined(__unix__) || defined(unix)) && !defined(USG) || (defined(__APPLE__) && defined(__GNUC__)) || defined(__NetBSD__)
#include <sys/param.h>
#else
#include <sys/vfs.h>
#endif
#include <dvdread/dvd_reader.h>
/* for solaris, but is also present in linux */
-#if (defined(BSD) && (BSD >= 199306)) ||(defined(__APPLE__) && defined(__GNUC__))
+#if (defined(BSD) && (BSD >= 199306) && !defined(__NetBSD__)) ||(defined(__APPLE__) && defined(__GNUC__)) || (defined(__NetBSD__) && (__NetBSD_Version__ < 200040000))
/* I don't know if *BSD have getopt-long... please tell me! */
//#define HAVE_GETOPT_LONG
#include <sys/mount.h>
+#define USE_STATFS
#else
#if (defined(__linux__))
#include <sys/statfs.h>
+#define USE_STATFS
#define HAVE_GETOPT_LONG
#else
#include <sys/statvfs.h>
@@ -143,14 +145,6 @@
bool quiet_flag = FALSE;
struct stat buf;
- /**
- * This case here has to be examined for every system vobcopy shall run under
- */
-#if defined( __linux__ ) || ( defined( BSD ) && ( BSD >= 199306 )) || (defined (__APPLE__) && defined(__GNUC__))
- struct statfs buf1;
-#elif !defined(__sun__)
- struct statvfs buf1;
-#endif
dvd_reader_t *dvd = NULL;
dvd_file_t *dvd_file;
extern char *optarg;
@@ -354,7 +348,7 @@
#if defined( __USE_FILE_OFFSET64 ) || ( defined( BSD ) && ( BSD >= 199306 ) ) || (defined (__APPLE__) && defined(__GNUC__))
case'l': /*large file output*/
- max_filesize_in_blocks = 4500000000000000;
+ max_filesize_in_blocks = 4500000000000000LL;
/* 2^63 / 2048 (not exactly) */
large_file_flag = TRUE;
break;
@@ -1702,7 +1696,7 @@
off_t freespace_getter( char *path, int verbosity_level )
{
-#if defined( __linux__ ) || ( defined( BSD ) && ( BSD >= 199306 ) ) || (defined (__APPLE__) && defined(__GNUC__))
+#ifdef USE_STATFS
struct statfs buf1;
#else
struct statvfs buf1;
@@ -1710,7 +1704,7 @@
/* ssize_t temp1, temp2; */
long temp1, temp2;
off_t sum;
-#if defined( __linux__ ) || ( defined( BSD ) && ( BSD >= 199306 ) ) || (defined (__APPLE__) && defined(__GNUC__))
+#ifdef USE_STATFS
statfs( path, &buf1 );
if( verbosity_level >= 1 )
fprintf( stderr, "Used the linux statfs\n" );
@@ -1739,7 +1733,7 @@
off_t usedspace_getter( char *path, int verbosity_level )
{
-#if defined( __linux__ ) || ( defined( BSD ) && ( BSD >= 199306 ) ) || (defined (__APPLE__) && defined(__GNUC__))
+#ifdef USE_STATFS
struct statfs buf2;
#else
struct statvfs buf2;
@@ -1747,7 +1741,7 @@
/* ssize_t temp1, temp2; */
long temp1, temp2;
off_t sum;
-#if defined( __linux__ ) || ( defined( BSD ) && ( BSD >= 199306 ) ) || (defined (__APPLE__) && defined(__GNUC__))
+#ifdef USE_STATFS
statfs( path, &buf2 );
if( verbosity_level >= 1 )
fprintf( stderr, "Used the linux statfs\n" );
|