summaryrefslogtreecommitdiff
path: root/clients/screenshot.c
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2016-03-16 14:15:18 -0700
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-17 14:13:13 +0200
commite99e4bf2b9aa13baae46f2a49ff9c9ed8ca631c7 (patch)
tree7a729aad4350c02a7b82f8ed7ae145d290f5a93b /clients/screenshot.c
parent4e221f0327cbc342d78916a62ace64368471d55b (diff)
downloadweston-e99e4bf2b9aa13baae46f2a49ff9c9ed8ca631c7.tar.gz
clients & tests: Unify multiple definitions of x*alloc and related functions
Direct fail_on_null calls now produce output like: [weston-info] clients/weston-info.c:714: out of memory xmalloc, et al produce output on failure like: [weston-info] out of memory (-1) Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'clients/screenshot.c')
-rw-r--r--clients/screenshot.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/clients/screenshot.c b/clients/screenshot.c
index 18b5f88f..6e43d5ce 100644
--- a/clients/screenshot.c
+++ b/clients/screenshot.c
@@ -38,6 +38,7 @@
#include <wayland-client.h>
#include "weston-screenshooter-client-protocol.h"
#include "shared/os-compatibility.h"
+#include "shared/xalloc.h"
/* The screenshooter is a good example of a custom object exposed by
* the compositor and serves as a test bed for implementing client
@@ -79,21 +80,6 @@ display_handle_geometry(void *data,
}
}
-static void *
-xmalloc(size_t size)
-{
- void *p;
-
- p = malloc(size);
- if (p == NULL) {
- fprintf(stderr, "%s: out of memory\n",
- program_invocation_short_name);
- exit(EXIT_FAILURE);
- }
-
- return p;
-}
-
static void
display_handle_mode(void *data,
struct wl_output *wl_output,