| 85 | } |
| 86 | |
| 87 | bool 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 | |
| 107 | bool MountRootFSImagePath(const fextl::string& SquashFS, bool EroFS) { |
| 108 | pid_t ParentTID = ::getpid(); |
no test coverage detected