diff --git a/Foundation/src/NamedEvent_UNIX.cpp b/Foundation/src/NamedEvent_UNIX.cpp index d0c73886c..19e3de026 100644 --- a/Foundation/src/NamedEvent_UNIX.cpp +++ b/Foundation/src/NamedEvent_UNIX.cpp @@ -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); diff --git a/Foundation/src/NamedMutex_UNIX.cpp b/Foundation/src/NamedMutex_UNIX.cpp index 26494dced..0f6488f7f 100644 --- a/Foundation/src/NamedMutex_UNIX.cpp +++ b/Foundation/src/NamedMutex_UNIX.cpp @@ -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);