List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:January 16 2001 3:39pm
Subject:Log files created readonly
View as plain text  

Hi!

>>>>> "Yuri" == Yuri Dario <mc6530@stripped> writes:

Yuri> Hi,
Yuri> under OS/2 the log file is created as a read-only file because S_I*
Yuri> permission are not specified togheter with O_CREAT.

Yuri> I have made this patch to 3.23.28 my_open.c sources

Yuri> DBUG_PRINT("my",("Name: '%s'  Flags: %d  MyFlags: %d",
Yuri> FileName, Flags, MyFlags));

Yuri> #if defined(MSDOS) || defined(__WIN__) || defined(__EMX__)
Yuri> if (Flags & O_CREAT)
Yuri> fd = open((my_string) FileName, Flags, MY_S_IREAD | MY_S_IWRITE);
Yuri> else if (Flags & O_SHARE)
Yuri> fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY,
Yuri> SH_DENYNO);
Yuri> else
Yuri> fd = open((my_string) FileName, Flags | O_BINARY);

Yuri> This doesn't work if both O_SHARE and O_CREAT are used, but this
Yuri> doesn't happen on OS2.

Could you explain to me why the old code didn't work ?

--------
  if (Flags & O_SHARE)
    fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
	       MY_S_IREAD | MY_S_IWRITE);
  else
    fd = open((my_string) FileName, Flags | O_BINARY,
	      MY_S_IREAD | MY_S_IWRITE);
---------------

O_CREATE and O_SHARE are never used together is not used in the MySQL code.
In other words, we whould in the case of O_CREATE execute the row:

    fd = open((my_string) FileName, Flags | O_BINARY,
	      MY_S_IREAD | MY_S_IWRITE);

which is identical to your row, except for O_BINARY, which should not
have any effect on your problem.

Regrds,
Monty
Thread
Log files created readonlyYuri Dario16 Jan
  • Log files created readonlyMichael Widenius16 Jan
  • Re: GSOC - WL#2878: Simple data auditingSergei Golubchik25 Mar