summaryrefslogtreecommitdiff
blob: 8d77fbd968a73e273435817e623da90355038506 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
https://lists.gnu.org/archive/html/bug-bash/2023-02/msg00000.html)

From 2cdf8b42885189b3cf7c47096b01f104e520546a Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Thu, 2 Feb 2023 05:43:37 +0000
Subject: [PATCH] aclocal.m4: fix -Wimplicit-function-declaration in dup2 check

dup2 requires a <unistd.h> include. Fixes the following when diffing config.log
 when testing with a stricter compiler:
```
-warning: call to undeclared function 'dup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
+error: call to undeclared function 'dup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
```
--- aclocal.m4
+++ aclocal.m4
@@ -284,6 +284,9 @@ AC_CACHE_VAL(bash_cv_dup2_broken,
 #include <sys/types.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 int
 main()
 {
--- configure
+++ configure
@@ -16990,6 +16990,9 @@ else
 #include <sys/types.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 int
 main()
 {