summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_copy.c4
-rw-r--r--mysys/my_static.c1
-rw-r--r--mysys/my_symlink2.c6
3 files changed, 7 insertions, 4 deletions
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index bfd7e957585..be131873118 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -54,7 +54,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES) /* Copy stat if possible */
new_file_stat=stat((char*) to, &new_stat_buff);
- if ((from_file=my_open(from,O_RDONLY,MyFlags)) >= 0)
+ if ((from_file=my_open(from,O_RDONLY | O_SHARE,MyFlags)) >= 0)
{
if (stat(from,&stat_buff))
{
@@ -64,7 +64,7 @@ int my_copy(const char *from, const char *to, myf MyFlags)
if (MyFlags & MY_HOLD_ORIGINAL_MODES && !new_file_stat)
stat_buff=new_stat_buff;
if ((to_file= my_create(to,(int) stat_buff.st_mode,
- O_WRONLY | O_TRUNC | O_BINARY,
+ O_WRONLY | O_TRUNC | O_BINARY | O_SHARE,
MyFlags)) < 0)
goto err;
diff --git a/mysys/my_static.c b/mysys/my_static.c
index f1339877273..3fc68455841 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -97,4 +97,5 @@ int (*fatal_error_handler_hook)(uint error,const char *str,myf MyFlags)=
my_bool NEAR my_disable_locking=0;
my_bool NEAR my_disable_async_io=0;
my_bool NEAR my_disable_flush_key_blocks=0;
+my_bool NEAR my_disable_symlinks=0;
my_bool NEAR mysys_uses_curses=0;
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c
index 671531393f7..9fcd993ac1f 100644
--- a/mysys/my_symlink2.c
+++ b/mysys/my_symlink2.c
@@ -62,7 +62,8 @@ File my_create_with_symlink(const char *linkname, const char *filename,
int my_delete_with_symlink(const char *name, myf MyFlags)
{
char link_name[FN_REFLEN];
- int was_symlink= !my_readlink(link_name, name, MYF(0));
+ int was_symlink= (!my_disable_symlinks &&
+ !my_readlink(link_name, name, MYF(0)));
int result;
DBUG_ENTER("my_delete_with_symlink");
@@ -90,7 +91,8 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags)
return my_rename(from, to, MyFlags);
#else
char link_name[FN_REFLEN], tmp_name[FN_REFLEN];
- int was_symlink= !my_readlink(link_name, name, MYF(0));
+ int was_symlink= (!my_disable_symlinks &&
+ !my_readlink(link_name, name, MYF(0)));
int result;
DBUG_ENTER("my_rename_with_symlink");