diff options
author | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-05-03 10:16:15 +0530 |
---|---|---|
committer | Sachin Setiya <sachin.setiya@mariadb.com> | 2017-05-03 10:16:15 +0530 |
commit | 1c142800486f58653aac007b0873d8c1aa712960 (patch) | |
tree | 512bb39b1227ca564ab77b4f085c7f9e541b26ba /mysys | |
parent | f359f664e9e4de804ffd33e222d00c6140655452 (diff) | |
parent | dbe2c3c5f21fd479fbe0993b045c0c30493ca07a (diff) | |
download | mariadb-git-1c142800486f58653aac007b0873d8c1aa712960.tar.gz |
Merge tag 'mariadb-5.5.56' into 5.5-galera
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/my_symlink2.c | 14 | ||||
-rw-r--r-- | mysys/mysys_priv.h | 6 |
2 files changed, 11 insertions, 9 deletions
diff --git a/mysys/my_symlink2.c b/mysys/my_symlink2.c index 5fe7b8fcae9..c851468ce1b 100644 --- a/mysys/my_symlink2.c +++ b/mysys/my_symlink2.c @@ -170,22 +170,20 @@ int my_rename_with_symlink(const char *from, const char *to, myf MyFlags) in this case both the symlink and the symlinked file are deleted, but only if the symlinked file is not in the datadir. */ -int my_handler_delete_with_symlink(PSI_file_key key, const char *name, - const char *ext, myf sync_dir) +int my_handler_delete_with_symlink(const char *filename, myf sync_dir) { - char orig[FN_REFLEN], real[FN_REFLEN]; + char real[FN_REFLEN]; int res= 0; DBUG_ENTER("my_handler_delete_with_symlink"); - fn_format(orig, name, "", ext, MY_UNPACK_FILENAME | MY_APPEND_EXT); - if (my_is_symlink(orig)) + if (my_is_symlink(filename)) { /* Delete the symlinked file only if the symlink is not pointing into datadir. */ - if (!(my_realpath(real, orig, MYF(0)) || mysys_test_invalid_symlink(real))) - res= mysql_file_delete(key, real, MYF(MY_NOSYMLINKS | MY_WME | sync_dir)); + if (!(my_realpath(real, filename, MYF(0)) || mysys_test_invalid_symlink(real))) + res= my_delete(real, MYF(MY_NOSYMLINKS | sync_dir)); } - DBUG_RETURN(mysql_file_delete(key, orig, MYF(MY_WME | sync_dir)) || res); + DBUG_RETURN(my_delete(filename, MYF(sync_dir)) || res); } diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h index 4b489504c26..661c4c184f1 100644 --- a/mysys/mysys_priv.h +++ b/mysys/mysys_priv.h @@ -89,9 +89,13 @@ void sf_free(void *ptr); void my_error_unregister_all(void); -#if !defined(O_PATH) && defined(O_EXEC) /* FreeBSD */ +#ifndef O_PATH /* not Linux */ +#if defined(O_SEARCH) /* Illumos */ +#define O_PATH O_SEARCH +#elif defined(O_EXEC) /* FreeBSD */ #define O_PATH O_EXEC #endif +#endif #ifdef O_PATH #define HAVE_OPEN_PARENT_DIR_NOSYMLINKS |