DescriptionIssue 5077/2: Improve portability of get_working_directory()
We used `getcwd()` with `PATH_MAX` to get the current directory.
However, `PATH_MAX` does not exist in environments such as GNU Hurd.
Debian developers avoided `PATH_MAX`
by using `get_current_dir_name()` instead of `getcwd()`.
It needed to protected with `#ifdef _GNU_SOURCE`
since `get_current_dir_name()` is glibc specific.
So `PATH_MAX` was still required in non-glibc environments.
There is a `getcwd()` extention that can avoid `PATH_MAX`
by setting the first argument to NULL.
The extension can be used in many environments, including glibc,
but POSIX does not recommend it in conforming applications.
This commit improves portability
by obtaining the current directory
with a method conforming to the standard.
Issue 5077/1: Fix build failure on GNU Hurd
LilyPond failed to build on GNU Hurd
because Hurd does not have PATH_MAX.
This commit is based on the following patch by Debian.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=761036
However, the patch raises an error on `make check`.
This commit has been fixed so that the error does not raise.
Patch Set 1 : From Debian #Patch Set 2 : Fix `make check` #Patch Set 3 : Improve portability #
MessagesTotal messages: 4
|