1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
Description: avoid the issue of PATH_MAX not being available on Hurd.
Call realpath() the POSIX way, with NULL as second parameter so that
the returned string is dynamically allocated. This way there is no
more need for the strdup() call.
Author: Gilles Filippini <pini@debian.org>
Bug-Debian: http://bugs.debian.org/627896
Bug: HDFFV-9209
Index: hdf5/src/H5Fint.c
===================================================================
--- hdf5.orig/src/H5Fint.c
+++ hdf5/src/H5Fint.c
@@ -1756,7 +1756,6 @@ H5F_build_actual_name(const H5F_t *f, co
int *fd; /* POSIX I/O file descriptor */
h5_stat_t st; /* Stat info from stat() call */
h5_stat_t fst; /* Stat info from fstat() call */
- char realname[PATH_MAX]; /* Fully resolved path name of file */
hbool_t want_posix_fd; /* Flag for retrieving file descriptor from VFD */
/* Perform a sanity check that the file or link wasn't switched
@@ -1793,12 +1792,8 @@ H5F_build_actual_name(const H5F_t *f, co
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "files' st_ino or st_dev fields changed!")
/* Get the resolved path for the file name */
- if(NULL == HDrealpath(name, realname))
+ if(NULL == (*actual_name = HDrealpath(name, NULL)))
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't retrieve real path for file")
-
- /* Duplicate the resolved path for the file name */
- if(NULL == (*actual_name = (char *)H5MM_strdup(realname)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "can't duplicate real path")
} /* end if */
} /* end if */
#endif /* H5_HAVE_SYMLINK */
|