mirror of
https://github.com/moparisthebest/pacman
synced 2025-02-28 09:21:53 -05:00
libalpm/handle.c: make realpath() call portable
BSD didn't support the NULL second argument GNU extension, so do it the old fashioned way. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
6af7dbcf72
commit
be387148c9
@ -285,10 +285,9 @@ int SYMEXPORT alpm_option_set_root(const char *root)
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
return(-1);
|
||||
}
|
||||
/* According to the man page, realpath is safe to use IFF the second arg is
|
||||
* NULL. */
|
||||
realroot = realpath(root, NULL);
|
||||
if(!realroot) {
|
||||
|
||||
realroot = calloc(PATH_MAX+1, sizeof(char));
|
||||
if(!realpath(root, realroot)) {
|
||||
pm_errno = PM_ERR_NOT_A_DIR;
|
||||
return(-1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user