Skip to content

Commit ba56b43

Browse files
committed
dont mount rootfs
stepmania/stepmania#2184
1 parent 833c33c commit ba56b43

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

src/Etterna/Globals/StepMania.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -992,13 +992,6 @@ sm_main(int argc, char* argv[])
992992
FILEMAN = new RageFileManager(argv[0]);
993993
FILEMAN->Mount("dir", Core::Platform::getAppDirectory(), "/");
994994

995-
#ifdef __unix__
996-
/* Mount the root filesystem, so we can read files in /proc, /etc, and so
997-
* on. This is /rootfs, not /root, to avoid confusion with root's home
998-
* directory. */
999-
FILEMAN->Mount("dir", "/", "/rootfs");
1000-
#endif
1001-
1002995
// load preferences and mount any alternative trees.
1003996
PREFSMAN = new PrefsManager;
1004997

src/arch/Sound/ALSA9Dynamic.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "Etterna/Globals/global.h"
22

33
#include <dlfcn.h>
4+
#include <sys/stat.h>
45

56
#define ALSA_PCM_NEW_HW_PARAMS_API
67
#define ALSA_PCM_NEW_SW_PARAMS_API
@@ -31,7 +32,8 @@ LoadALSA()
3132
* know if anyone actually does that, though: they're often configured to
3233
* load snd (the core module) if ALSA devices are accessed, but hardware
3334
* drivers are typically loaded on boot. */
34-
if (!IsADirectory("/rootfs/proc/asound/"))
35+
struct stat st;
36+
if (stat("/proc/asound/", &st) == -1 || !(st.st_mode & S_IFDIR))
3537
return "/proc/asound/ does not exist";
3638

3739
ASSERT(Handle == NULL);

src/arch/Sound/ALSA9Helpers.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "ALSA9Dynamic.h"
66
#include "Etterna/Singletons/PrefsManager.h"
77

8+
#include <fstream>
9+
#include <string>
810
#include <algorithm>
911

1012
/* int err; must be defined before using this macro */
@@ -160,10 +162,11 @@ Alsa9Buf::GetSoundCardDebugInfo()
160162
return;
161163
done = true;
162164

163-
if (DoesFileExist("/rootfs/proc/asound/version")) {
164-
std::string sVersion;
165-
GetFileContents("/rootfs/proc/asound/version", sVersion, true);
166-
Locator::getLogger()->info("ALSA: {}", sVersion.c_str());
165+
std::ifstream f("/proc/asound/version");
166+
if (f.good()) {
167+
std::string version;
168+
std::getline(f, version);
169+
Locator::getLogger()->info("ALSA: {}", version.c_str());
167170
}
168171

169172
InitializeErrorHandler();

src/arch/Sound/RageSoundDriver_OSS.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <sys/ioctl.h>
1818
#include <sys/soundcard.h>
1919
#include <sys/select.h>
20+
#include <sys/stat.h>
2021

2122
REGISTER_SOUND_DRIVER_CLASS(OSS);
2223

@@ -145,8 +146,8 @@ RageSoundDriver_OSS::CheckOSSVersion(int fd)
145146
*/
146147
#ifndef FORCE_OSS
147148
#define ALSA_SNDRV_OSS_VERSION ((3 << 16) | (8 << 8) | (1 << 4) | (0))
148-
if (version == ALSA_SNDRV_OSS_VERSION &&
149-
IsADirectory("/rootfs/proc/asound"))
149+
struct stat st;
150+
if( version == ALSA_SNDRV_OSS_VERSION && stat("/proc/asound", &st) && (st.st_mode & S_IFDIR) )
150151
return "RageSoundDriver_OSS: ALSA detected. ALSA OSS emulation is "
151152
"buggy; use ALSA natively.";
152153
#endif

0 commit comments

Comments
 (0)