blob: 11508ee0e2c9e362006b5e19737e4296b33a1fef [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001From 75bea7c72a919859674f493548653de88f96c798 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Mon, 22 Apr 2019 10:36:13 +0800
4Subject: [PATCH] test-getopt-posix fix
5
6fix below problem:
7test-getopt.h:754: assertion 'strcmp (argv[1], "donald") == 0' failed
8
9get this patch from
10https://github.com/habitat-sh/core-plans/blob/master/m4/fix-test-getopt-posix-with-glibc-2.26.patch
11
12Upstream-Status: Pending
13
14have report this bug to m4-discuss@gnu.org
15
16Signed-off-by: Changqing Li <changqing.li@windriver.com>
17---
18 tests/test-getopt-posix.c | 7 +++++++
19 1 file changed, 7 insertions(+)
20
21diff --git a/tests/test-getopt-posix.c b/tests/test-getopt-posix.c
22index 5532271..2a3d511 100644
23--- a/tests/test-getopt-posix.c
24+++ b/tests/test-getopt-posix.c
25@@ -22,6 +22,13 @@
26 ftell link warning if we are not using the gnulib ftell module. */
27 #define _GL_NO_LARGE_FILES
28
29+/*
30+ * Glibc 2.26 does hard include bits/getopt_posix.h which causes the system
31+ * to use glibc's getopt but the tests expect gnulib behavior. Until a better
32+ * fix is available this avoids that mis-resolution.
33+ */
34+#include <getopt.h>
35+
36 /* POSIX and glibc provide the getopt() function in <unistd.h>, see
37 http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
38 https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html
39--
402.7.4
41