mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-23 23:16:39 +01:00
NamedEvent/NamedMutex: change file open mode to read-only
This commit is contained in:
parent
40ae2aa2ed
commit
a7a8571e25
@ -60,7 +60,7 @@ 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
|
||||
|
@ -60,7 +60,7 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user