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() :
OString tmp =
OUStringToOString(rufn, osl_getThreadTextEncoding());
file_ = fopen(tmp.getStr(), "r+");
/* create if not exist */
if (NULL == file_) {
mode_t umask_ = umask(S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
file_ = fopen(tmp.getStr(), "w+");
umask(umask_);
int fd = open(tmp.getStr(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd != -1) {
file_ = fdopen(fd, "w+");
if (file_ == 0) {
close(fd);
}
}
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