Fixed log manager writing to the file when it checks that they exist.
This commit is contained in:
@ -2356,7 +2356,7 @@ static bool check_file_and_path(
|
|||||||
/** File exists, check permission to read/write */
|
/** File exists, check permission to read/write */
|
||||||
if (errno == EEXIST)
|
if (errno == EEXIST)
|
||||||
{
|
{
|
||||||
/** Open file and write a byte for test */
|
/** Open file */
|
||||||
fd = open(filename, O_CREAT|O_RDWR, S_IRWXU|S_IRWXG);
|
fd = open(filename, O_CREAT|O_RDWR, S_IRWXU|S_IRWXG);
|
||||||
|
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
@ -2387,8 +2387,7 @@ static bool check_file_and_path(
|
|||||||
{
|
{
|
||||||
if (writable)
|
if (writable)
|
||||||
{
|
{
|
||||||
char c = ' ';
|
if (access(filename,W_OK) == 0)
|
||||||
if (write(fd, &c, 1) == 1)
|
|
||||||
{
|
{
|
||||||
*writable = true;
|
*writable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user