mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 11:06:50 +01:00
use non-zero project ID ('p') for ftok()
This commit is contained in:
@@ -65,7 +65,7 @@ NamedMutexImpl::NamedMutexImpl(const std::string& name):
|
||||
close(fd);
|
||||
else
|
||||
throw SystemException(Poco::format("cannot create named mutex %s (lockfile)", fileName), _name);
|
||||
key_t key = ftok(fileName.c_str(), 0);
|
||||
key_t key = ftok(fileName.c_str(), 'p');
|
||||
if (key == -1)
|
||||
throw SystemException(Poco::format("cannot create named mutex %s (ftok() failed, errno=%d)", fileName, errno), _name);
|
||||
_semid = semget(key, 1, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | IPC_CREAT | IPC_EXCL);
|
||||
|
||||
Reference in New Issue
Block a user