Lines 1-6
Link Here
|
1 |
--- JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp.orig 2019-04-17 16:56:20 UTC |
1 |
--- JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp.orig 2019-04-17 16:56:20 UTC |
2 |
+++ JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp |
2 |
+++ JuceLibraryCode/modules/juce_core/native/juce_linux_Files.cpp |
3 |
@@ -216,7 +216,7 @@ bool Process::openDocument (const String& fileName, co |
3 |
@@ -35,8 +35,16 @@ bool File::isOnCDRomDrive() const |
|
|
4 |
{ |
5 |
struct statfs buf; |
6 |
|
7 |
+#if JUCE_BSD |
8 |
+ if (statfs(getFullPathName().toUTF8(), &buf) == 0) { |
9 |
+ String s(buf.f_fstypename); |
10 |
+ return s.compare("cd9660") == 0 || s.compare("udf") == 0; |
11 |
+ } |
12 |
+ return false; |
13 |
+#else |
14 |
return statfs (getFullPathName().toUTF8(), &buf) == 0 |
15 |
&& buf.f_type == (short) U_ISOFS_SUPER_MAGIC; |
16 |
+#endif |
17 |
} |
18 |
|
19 |
bool File::isOnHardDisk() const |
20 |
@@ -45,6 +53,13 @@ bool File::isOnHardDisk() const |
21 |
|
22 |
if (statfs (getFullPathName().toUTF8(), &buf) == 0) |
23 |
{ |
24 |
+#if JUCE_BSD |
25 |
+ String s(buf.f_fstypename); |
26 |
+ if (s.compare("cd9660") == 0 || s.compare("udf") == 0 || |
27 |
+ s.compare("nfs") == 0 || s.compare("smbfs") == 0) { |
28 |
+ return false; |
29 |
+ } |
30 |
+#else |
31 |
switch (buf.f_type) |
32 |
{ |
33 |
case U_ISOFS_SUPER_MAGIC: // CD-ROM |
34 |
@@ -55,6 +70,7 @@ bool File::isOnHardDisk() const |
35 |
|
36 |
default: break; |
37 |
} |
38 |
+#endif |
39 |
} |
40 |
|
41 |
// Assume so if this fails for some reason |
42 |
@@ -216,7 +232,7 @@ bool Process::openDocument (const String& fileName, co |
4 |
setsid(); |
43 |
setsid(); |
5 |
|
44 |
|
6 |
// Child process |
45 |
// Child process |