summaryrefslogtreecommitdiff
path: root/ivi-shell
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 /ivi-shell
parent4e221f0327cbc342d78916a62ace64368471d55b (diff)
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 'ivi-shell')
-rw-r--r--ivi-shell/hmi-controller.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index 86f7c50e..0b932d62 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -61,6 +61,7 @@
#include "ivi-layout-export.h"
#include "ivi-hmi-controller-server-protocol.h"
#include "shared/helpers.h"
+#include "shared/xalloc.h"
/*****************************************************************************
* structure, globals
@@ -151,17 +152,6 @@ controller_module_init(struct weston_compositor *ec,
* local functions
****************************************************************************/
static void *
-fail_on_null(void *p, size_t size, char *file, int32_t line)
-{
- if (size && !p) {
- weston_log("%s(%d) %zd: out of memory\n", file, line, size);
- exit(EXIT_FAILURE);
- }
-
- return p;
-}
-
-static void *
mem_alloc(size_t size, char *file, int32_t line)
{
return fail_on_null(calloc(1, size), size, file, line);