List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:December 5 2000 12:06am
Subject:mysql-3.23.28 NT, binary files opened as read-only
View as plain text  
Hi!

>>>>> "Roger" == Roger Larsson <larssoro@stripped> writes:

Roger> Hi,
Roger> I've noticed taht as of 3.23.28 all binary files are created as
Roger> read-only under Windows NT. The problem is the call to open()
Roger> under NT, if O_CREAT is specified, the third parameter (pmode) to
Roger> open() is mandatory. If the file does already exist, the parameter is
Roger> ignored. I assume it is not intentional to create the files as
Roger> read-only.

Roger> I suggest the patch below.

Roger> Best regards,
Roger> /Roger Larsson

Roger> *** E:\TEMP\my_open.cdDAQBA	Sun Dec 03 22:25:02 2000
Roger> --- E:\TEMP\my_open.c.savedDAdLG	Sun Dec 03 22:25:02 2000
Roger> ***************
Roger> *** 17,23 ****

Roger>   #define USES_TYPES
Roger>   #include "mysys_priv.h"
Roger> - #include <my_dir.h>
Roger>   #include "mysys_err.h"
Roger>   #include <errno.h>
Roger>   #if defined(MSDOS) || defined(__WIN__)
Roger> --- 17,22 ----
Roger> ***************
Roger> *** 37,47 ****
Roger>   		   FileName, Flags, MyFlags));
Roger>   #if defined(MSDOS) || defined(__WIN__)
Roger>     if (Flags & O_SHARE)
Roger> !     fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, 
Roger> SH_DENYNO,
Roger> !                MY_S_IREAD | MY_S_IWRITE);
Roger>     else
Roger> !     fd = open((my_string) FileName, Flags | O_BINARY,
Roger> !               MY_S_IREAD | MY_S_IWRITE);
Roger>   #elif !defined(NO_OPEN_3)
Roger>     fd = open(FileName, Flags, my_umask);	/* Normal unix */
Roger>   #else
Roger> --- 36,44 ----
Roger>   		   FileName, Flags, MyFlags));
Roger>   #if defined(MSDOS) || defined(__WIN__)
Roger>     if (Flags & O_SHARE)
Roger> !     fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, 
Roger> SH_DENYNO);
Roger>     else
Roger> !     fd = open((my_string) FileName, Flags | O_BINARY);
Roger>   #elif !defined(NO_OPEN_3)
Roger>     fd = open(FileName, Flags, my_umask);	/* Normal unix */
Roger>   #else


<cut>

Applied; Thanks!

Regards,
Monty
Thread
mysql-3.23.28 NT, binary files opened as read-onlyRoger Larsson3 Dec
  • Re: mysql-3.23.28 NT, binary files opened as read-onlySinisa Milivojevic4 Dec
  • Re: mysql-3.23.28 NT, binary files opened as read-onlySasha Pachev4 Dec
  • mysql-3.23.28 NT, binary files opened as read-onlyMichael Widenius5 Dec
  • Compile optionsAntony T Curtis5 Dec
    • Compile optionsMichael Widenius12 Dec