From cab9aeaff5e9a73f37f9895d67a63864803a4dd6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Thu, 10 Oct 2013 19:21:05 -0700 Subject: [PATCH] multi-resource: Don't include non-existing xmalloc.h It existed on my local disk, of course. Just copy over xzmalloc(). --- clients/multi-resource.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/clients/multi-resource.c b/clients/multi-resource.c index fda9e7d..c4a0c18 100644 --- a/clients/multi-resource.c +++ b/clients/multi-resource.c @@ -39,7 +39,6 @@ #include #include "../shared/os-compatibility.h" -#include "xmalloc.h" struct device { enum { KEYBOARD, POINTER } type; @@ -82,6 +81,20 @@ static const struct wl_buffer_listener buffer_listener = { buffer_release }; +static inline void * +xzalloc(size_t s) +{ + void *p; + + p = calloc(1, s); + if (p == NULL) { + fprintf(stderr, "%s: out of memory\n", program_invocation_short_name); + exit(EXIT_FAILURE); + } + + return p; +} + static int attach_buffer(struct window *window, int width, int height) { -- 2.7.4