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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
https://github.com/mej/libast/pull/5
https://bugs.gentoo.org/871705
From 6c50760566499ef34cfd34ee38945e2612f4f7bf Mon Sep 17 00:00:00 2001
From: Ryan Schmidt <git@ryandesign.com>
Date: Mon, 7 Dec 2020 01:34:46 -0600
Subject: [PATCH] Fix implicit declaration of library function exit
--- a/libast.m4
+++ b/libast.m4
@@ -505,10 +505,10 @@ char ovbuf[7];
int i;
for (i=0; i<7; i++) ovbuf[i]='x';
snprintf(ovbuf, 4,"foo%s", "bar");
-if (ovbuf[5]!='x') exit(1);
+if (ovbuf[5]!='x') return 1;
snprintf(ovbuf, 4,"foo%d", 666);
-if (ovbuf[5]!='x') exit(1);
-exit(0);
+if (ovbuf[5]!='x') return 1;
+return 0;
} >>
changequote([, ])
, dps_cv_snprintf_bug=0, dps_cv_snprintf_bug=1, dps_cv_snprintf_bug=2)
@@ -550,10 +550,10 @@ int main(void)
char ovbuf[8] = "xxxxxxx";
int i;
prnt(ovbuf, "foo%s", "bar");
- if (ovbuf[5]!='x') {fprintf(stderr, "buffer: %s\n", ovbuf); exit(1);}
+ if (ovbuf[5]!='x') {fprintf(stderr, "buffer: %s\n", ovbuf); return 1;}
prnt(ovbuf, "foo%d", 666);
- if (ovbuf[5]!='x') {fprintf(stderr, "buffer: %s\n", ovbuf); exit(1);}
- exit(0);
+ if (ovbuf[5]!='x') {fprintf(stderr, "buffer: %s\n", ovbuf); return 1;}
+ return 0;
} >>
changequote([, ])
, dps_cv_vsnprintf_bug=0, dps_cv_vsnprintf_bug=1, dps_cv_vsnprintf_bug=2)
@@ -651,10 +651,10 @@ AC_DEFUN([dps_rlimit_nproc], [
AC_TRY_RUN(
changequote(<<, >>)dnl
<<
-#ifndef HAVE_STDLIB_H
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif /* HAVE_STDLIB_H */
-#ifndef HAVE_SIGNAL_H
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif /* HAVE_SIGNAL_H */
#ifdef HAVE_UNISTD_H
@@ -699,10 +699,10 @@ AC_DEFUN([dps_rlimit_memlock], [
AC_TRY_RUN(
changequote(<<, >>)dnl
<<
-#ifndef HAVE_STDLIB_H
+#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif /* HAVE_STDLIB_H */
-#ifndef HAVE_SIGNAL_H
+#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif /* HAVE_SIGNAL_H */
#ifdef HAVE_UNISTD_H
|