Fixed log manager writing to the file when it checks that they exist.

This commit is contained in:
Markus Makela
2015-02-15 19:51:40 +02:00
parent cb35472133
commit 691eefe0de

View File

@ -2356,7 +2356,7 @@ static bool check_file_and_path(
/** File exists, check permission to read/write */
if (errno == EEXIST)
{
/** Open file and write a byte for test */
/** Open file */
fd = open(filename, O_CREAT|O_RDWR, S_IRWXU|S_IRWXG);
if (fd == -1)
@ -2387,8 +2387,7 @@ static bool check_file_and_path(
{
if (writable)
{
char c = ' ';
if (write(fd, &c, 1) == 1)
if (access(filename,W_OK) == 0)
{
*writable = true;
}