Merge branch 'poco-1.7.9' into poco-1.8.0

This commit is contained in:
Günter Obiltschnig
2017-09-11 21:08:04 +02:00
4 changed files with 17 additions and 9 deletions

View File

@@ -25,6 +25,10 @@ Release 1.7.9 (2017-09-11)
statements, e.g. writing empty strings.
- added POCO_DEPRECATED macro which will be used in the future to deprecate
classes and methods.
- Poco::NamedMutex and Poco::NamedEvent (System V Semaphores implementation): files are
now opened with O_RDONLY | O_CREAT instead of O_WRONLY | O_CREAT, allowing sharing
between different users. Furthermore, ftok() is called with 'p' as project ID
argument.
Release 1.7.8p3 (2017-06-22)

View File

@@ -58,12 +58,12 @@ NamedEventImpl::NamedEventImpl(const std::string& name):
if ((long) _sem == (long) SEM_FAILED)
throw SystemException(Poco::format("cannot create named mutex %s (sem_open() failed, errno=%d)", fileName, errno), _name);
#else
int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
int fd = open(fileName.c_str(), O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd != -1)
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);

View File

@@ -58,12 +58,12 @@ NamedMutexImpl::NamedMutexImpl(const std::string& name):
if ((long) _sem == (long) SEM_FAILED)
throw SystemException(Poco::format("cannot create named mutex %s (sem_open() failed, errno=%d)", fileName, errno), _name);
#else
int fd = open(fileName.c_str(), O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
int fd = open(fileName.c_str(), O_RDONLY | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd != -1)
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);

View File

@@ -26,6 +26,10 @@ AAAIntroduction
statements, e.g. writing empty strings.
- added POCO_DEPRECATED macro which will be used in the future to deprecate
classes and methods.
- Poco::NamedMutex and Poco::NamedEvent (System V Semaphores implementation): files are
now opened with O_RDONLY | O_CREAT instead of O_WRONLY | O_CREAT, allowing sharing
between different users. Furthermore, ftok() is called with 'p' as project ID
argument.
!!!Release 1.7.8p3