Description: fix gnulib unittests with glibc 2.26 Due to glibc and gnulib exchanging and syncing getopt implementations it now uses the implementation form glibc but expects the former gnulib behavior. Until fully resolved override the test include to use gnulib function as it used to be before. It is somewhat ok to do so as the only real user of getopt so far is an example at examples/admin/logging.c. All others use getopt_long which does not have this function name collision between unistd.h and getopt.h. Note: to be replaced by the final fix as soon as that is available. Forwarded: yes https://www.redhat.com/archives/libvir-list/2017-September/msg01039.html Author: Christian Ehrhardt Bug-Ubuntu: https://bugs.launchpad.net/bugs/1718668 Last-Update: 2017-09-28 test-getopt-posix.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/gnulib/tests/test-getopt-posix.c +++ b/gnulib/tests/test-getopt-posix.c @@ -22,6 +22,13 @@ ftell link warning if we are not using the gnulib ftell module. */ #define _GL_NO_LARGE_FILES +/* + * Glibc 2.26 does hard include bits/getopt_posix.h which causes the system + * to use glibc's getopt but the tests expect gnulib behavior. Until a better + * fix is available this avoids that mis-resolution. + */ +#include + /* POSIX and glibc provide the getopt() function in , see http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html