diff options
author | Petr Machata <pmachata@redhat.com> | 2012-12-08 03:33:47 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-12-10 11:48:59 +0100 |
commit | 86a7b48310e0fd551f7f3d88ea9ad39c1a2807c6 (patch) | |
tree | e58cb8e545f4d720a17d8ef7009ae8d78d62a978 /read_config_file.c | |
parent | b6c5c8c51f954cfbe76424fd57c33a87166f0545 (diff) | |
download | ltrace-86a7b48310e0fd551f7f3d88ea9ad39c1a2807c6.tar.gz |
Avoid using non-portable error.h in generic code
Diffstat (limited to 'read_config_file.c')
-rw-r--r-- | read_config_file.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/read_config_file.c b/read_config_file.c index e247436..70d3bd3 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; |