Kaydet (Commit) 8fd54c10 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Related fdo#60338: Do not use umask(3) in a MT program

Change-Id: Ie515201e44ad58faf623a04981e891c0b3f4a19d
üst b3ddc791
...@@ -63,13 +63,12 @@ recently_used_file::recently_used_file() : ...@@ -63,13 +63,12 @@ recently_used_file::recently_used_file() :
OString tmp = OString tmp =
OUStringToOString(rufn, osl_getThreadTextEncoding()); OUStringToOString(rufn, osl_getThreadTextEncoding());
file_ = fopen(tmp.getStr(), "r+"); int fd = open(tmp.getStr(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd != -1) {
/* create if not exist */ file_ = fdopen(fd, "w+");
if (NULL == file_) { if (file_ == 0) {
mode_t umask_ = umask(S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH); close(fd);
file_ = fopen(tmp.getStr(), "w+"); }
umask(umask_);
} }
if (NULL == file_) if (NULL == file_)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment