summaryrefslogtreecommitdiffstats
path: root/devel/ltrace/patches/0001-Avoid-using-non-portable-error.h-in-generic-code.patch
blob: 531677e2457d47ee9ede9c015d264c4d5d257b7e (plain) (blame)
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
From 86a7b48310e0fd551f7f3d88ea9ad39c1a2807c6 Mon Sep 17 00:00:00 2001
From: Petr Machata <pmachata@redhat.com>
Date: Sat, 8 Dec 2012 03:33:47 +0100
Subject: [PATCH] Avoid using non-portable error.h in generic code

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 read_config_file.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/read_config_file.c b/read_config_file.c
index e247436a307d..70d3bd32038b 100644
--- a/read_config_file.c
+++ b/read_config_file.c
@@ -27,7 +27,6 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <errno.h>
-#include <error.h>
 #include <assert.h>

 #include "common.h"
@@ -1258,8 +1257,11 @@ void
 init_global_config(void)
 {
	struct arg_type_info *info = malloc(2 * sizeof(*info));
-	if (info == NULL)
-		error(1, errno, "malloc in init_global_config");
+	if (info == NULL) {
+		fprintf(stderr, "Couldn't init global config: %s\n",
+			strerror(errno));
+		exit(1);
+	}

	memset(info, 0, 2 * sizeof(*info));
	info[0].type = ARGTYPE_POINTER;
--
2.23.0