List:Internals« Previous MessageNext Message »
From:Sasha Pachev Date:December 4 2000 7:52pm
Subject:Re: mysql-3.23.28 NT, binary files opened as read-only
View as plain text  
On Sunday 03 December 2000 15:28, Roger Larsson wrote:
>Hi,
>I've noticed taht as of 3.23.28 all binary files are created as
>read-only under Windows NT. The problem is the call to open()
>under NT, if O_CREAT is specified, the third parameter (pmode) to
>open() is mandatory. If the file does already exist, the parameter is
>ignored. I assume it is not intentional to create the files as
>read-only.
>
>I suggest the patch below.
>
>Best regards,
>/Roger Larsson
>
>*** E:\TEMP\my_open.cdDAQBA	Sun Dec 03 22:25:02 2000
>--- E:\TEMP\my_open.c.savedDAdLG	Sun Dec 03 22:25:02 2000
>***************
>*** 17,23 ****
>
>  #define USES_TYPES
>  #include "mysys_priv.h"
>- #include <my_dir.h>
>  #include "mysys_err.h"
>  #include <errno.h>
>  #if defined(MSDOS) || defined(__WIN__)
>--- 17,22 ----
>***************
>*** 37,47 ****
>  		   FileName, Flags, MyFlags));
>  #if defined(MSDOS) || defined(__WIN__)
>    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);
>  #elif !defined(NO_OPEN_3)
>    fd = open(FileName, Flags, my_umask);	/* Normal unix */
>  #else
>--- 36,44 ----
>  		   FileName, Flags, MyFlags));
>  #if defined(MSDOS) || defined(__WIN__)
>    if (Flags & O_SHARE)
>!     fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, 
>SH_DENYNO);
>    else
>!     fd = open((my_string) FileName, Flags | O_BINARY);
>  #elif !defined(NO_OPEN_3)
>    fd = open(FileName, Flags, my_umask);	/* Normal unix */
>  #else

Thanks for the patch - we will fix the problem in 3.23.29

-- 
MySQL Development Team
   __  ___     ___ ____  __ 
  /  |/  /_ __/ __/ __ \/ /   Sasha Pachev <sasha@stripped>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Provo, Utah, USA
       <___/                  
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