mirror of
https://github.com/pocoproject/poco.git
synced 2025-03-04 07:27:23 +01:00
use non-zero project ID ('p') for ftok()
This commit is contained in:
parent
a7a8571e25
commit
d558d5eef9
@ -65,7 +65,7 @@ NamedEventImpl::NamedEventImpl(const std::string& name):
|
||||
close(fd);
|
||||
else
|
||||
throw SystemException(Poco::format("cannot create named event %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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user