Line 0
Link Here
|
|
|
1 |
--- src/dvd_reader.c.orig 2018-01-17 21:35:39 UTC |
2 |
+++ src/dvd_reader.c |
3 |
@@ -64,7 +64,7 @@ static inline int _private_gettimeofday( struct timeva |
4 |
# include <sys/ucred.h> |
5 |
# include <sys/mount.h> |
6 |
#elif defined(SYS_BSD) |
7 |
-# include <fstab.h> |
8 |
+# include <sys/mount.h> |
9 |
#elif defined(__linux__) |
10 |
# include <mntent.h> |
11 |
# include <paths.h> |
12 |
@@ -420,7 +420,7 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath, |
13 |
} else if( S_ISDIR( fileinfo.st_mode ) ) { |
14 |
dvd_reader_t *auth_drive = 0; |
15 |
#if defined(SYS_BSD) |
16 |
- struct fstab* fe; |
17 |
+ struct statfs fs; |
18 |
#elif defined(__sun) || defined(__linux__) |
19 |
FILE *mntfile; |
20 |
#endif |
21 |
@@ -511,14 +511,16 @@ static dvd_reader_t *DVDOpenCommon( const char *ppath, |
22 |
} |
23 |
} |
24 |
#elif defined(SYS_BSD) |
25 |
- if( ( fe = getfsfile( path_copy ) ) ) { |
26 |
- dev_name = bsd_block2char( fe->fs_spec ); |
27 |
- fprintf( stderr, |
28 |
- "libdvdread: Attempting to use device %s" |
29 |
- " mounted on %s for CSS authentication\n", |
30 |
- dev_name, |
31 |
- fe->fs_file ); |
32 |
- auth_drive = DVDOpenImageFile( dev_name, NULL, NULL, have_css ); |
33 |
+ if( statfs( path_copy, &fs ) == 0 ) { |
34 |
+ if( !strcmp( path_copy, fs.f_mntonname ) ) { |
35 |
+ dev_name = bsd_block2char( fs.f_mntfromname ); |
36 |
+ fprintf( stderr, |
37 |
+ "libdvdread: Attempting to use device %s" |
38 |
+ " mounted on %s for CSS authentication\n", |
39 |
+ dev_name, |
40 |
+ fs.f_mntonname ); |
41 |
+ auth_drive = DVDOpenImageFile( dev_name, NULL, NULL, have_css ); |
42 |
+ } |
43 |
} |
44 |
#elif defined(__sun) |
45 |
mntfile = fopen( MNTTAB, "r" ); |