diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-06-20 12:31:17 +0300 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2017-06-20 12:31:17 +0300 |
commit | 8baf9b0c469e2845d15cc1181bc6b101cdfba087 (patch) | |
tree | f5808173b56692f71874213639401af1e18cb146 /mysys/mysys_priv.h | |
parent | 5e4f4ec8211b61e71ec29069161d0f41f4c05376 (diff) | |
parent | ded614d7dbc930e373d1a69a0d2a7e4bf0a2c6d3 (diff) | |
download | mariadb-git-8baf9b0c469e2845d15cc1181bc6b101cdfba087.tar.gz |
Merge remote-tracking branch '5.5' into 10.0
Diffstat (limited to 'mysys/mysys_priv.h')
-rw-r--r-- | mysys/mysys_priv.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h index 51650567609..b33e155a718 100644 --- a/mysys/mysys_priv.h +++ b/mysys/mysys_priv.h @@ -110,12 +110,21 @@ const char *my_open_parent_dir_nosymlinks(const char *pathname, int *pdfd); res= AT; \ if (dfd >= 0) close(dfd); \ return res; -#elif defined(HAVE_REALPATH) +#elif defined(HAVE_REALPATH) && defined(PATH_MAX) #define NOSYMLINK_FUNCTION_BODY(AT,NOAT) \ char buf[PATH_MAX+1]; \ if (realpath(pathname, buf) == NULL) return -1; \ if (strcmp(pathname, buf)) { errno= ENOTDIR; return -1; } \ return NOAT; +#elif defined(HAVE_REALPATH) +#define NOSYMLINK_FUNCTION_BODY(AT,NOAT) \ + char *buf= realpath(pathname, NULL); \ + int res; \ + if (buf == NULL) return -1; \ + if (strcmp(pathname, buf)) { errno= ENOTDIR; res= -1; } \ + else res= NOAT; \ + free(buf); \ + return res; #else #define NOSYMLINK_FUNCTION_BODY(AT,NOAT) \ return NOAT; |