Created attachment 29765 [details] [review] Guard get_current_dir_name. If not available, fall back to getcwd(). The testsuite uses get_current_dir_name() to determine the current directory for the bootstrap download of the images. Unfortunately this function is a GNU-extension and thus not available on platforms that aren't GNU (MacOSX Snow Leopard in this case). The result is a compilation error for the test suite. It can be fixed by guarding get_current_dir_name() with _GNU_SOURCE and if it's not available fall back to POSIX getcwd(). The attached patch does that. Test suite has been tested with the patch on the aforementioned Snow Leopard as well as on Linux 2.6.31.
The patch never release the memory allocated by malloc() Also I'd rather have the function detected by configure rather than have a check on _GNU_SOURCE. I can't really apply it like that.
(In reply to comment #1) > The patch never release the memory allocated by malloc() > > Also I'd rather have the function detected by configure rather than have a > check on _GNU_SOURCE. I can't really apply it like that. > The memory is freed in the line right after the patch chunk: free(dir); The malloc that needs to be done explicitly for getcwd() is done implicitly by get_current_dir_name(), so for both you need to free the memory, anyway, which is done. Well, go ahead and detect the function with configure and change the guard's name appropriately. There should have already been a check for being a GNU-box, though.
(In reply to comment #2) > The memory is freed in the line right after the patch chunk: free(dir); The > malloc that needs to be done explicitly for getcwd() is done implicitly by > get_current_dir_name(), so for both you need to free the memory, anyway, which > is done. My bad. Sorry about that I didn't read properly > Well, go ahead and detect the function with configure and change the guard's > name appropriately. There should have already been a check for being a GNU-box, > though. Why a "check for being a GNU-box"?
I pushed a fix to git master for next release.
*** Bug 32657 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.