summaryrefslogtreecommitdiff
path: root/dev-util/ltrace/files/ltrace-0.7.3-no-error.h.patch
blob: 56aea7a54d4d22959ded31bbf5f8aabd03b4ef40 (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
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

---
 read_config_file.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--- 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.25.2