MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / DowngradeRootFSPipeToReadLock

Function DowngradeRootFSPipeToReadLock

Source/Tools/FEXServer/SquashFS.cpp:87–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool DowngradeRootFSPipeToReadLock() {
88 flock lk {
89 .l_type = F_RDLCK,
90 .l_whence = SEEK_SET,
91 .l_start = 0,
92 .l_len = 0,
93 };
94 int Ret = fcntl(ServerRootFSLockFD, F_SETLK, &lk);
95
96 if (Ret == -1) {
97 // This shouldn't occur
98 LogMan::Msg::EFmt("[FEXServer] Unable to downgrade a rootfs write lock to a read lock {} {}", errno, strerror(errno));
99 close(ServerRootFSLockFD);
100 ServerRootFSLockFD = -1;
101 return false;
102 }
103
104 return true;
105}
106
107bool MountRootFSImagePath(const fextl::string& SquashFS, bool EroFS) {
108 pid_t ParentTID = ::getpid();

Callers 1

InitializeSquashFSFunction · 0.85

Calls 2

EFmtFunction · 0.85
closeFunction · 0.85

Tested by

no test coverage detected