Merge pull request #2127 from PhenomRetroShare/Add_PID_InLockFile

Add current PID in Lock file.
This commit is contained in:
csoler 2020-11-26 20:18:53 +01:00 committed by GitHub
commit 41357489c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -892,6 +892,10 @@ int RsDirUtil::createLockFile(const std::string& lock_file_path, rs_lock_handle_
return 2;
}
// Write to lock file our pid
std::string ourPID = std::to_string(::getpid());
write(lock_handle, ourPID.c_str(), sizeof(char)*ourPID.size() );
return 0;
#else
// Suspended. The user should make sure he's not already using the file descriptor.