84b277
From 131d8e2cf65eb3c6dfc691676ca6f0a55ae44d71 Mon Sep 17 00:00:00 2001
84b277
From: Lennart Poettering <lennart@poettering.net>
84b277
Date: Mon, 11 Aug 2014 18:23:47 +0200
84b277
Subject: [PATCH] bootchart: it's not OK to return -1 from a main program
84b277
84b277
(cherry-picked from 4155f7d4be5053d5f34a26e5437fd85e1fe00fa3)
84b277
84b277
Resolves: #1147524
84b277
---
84b277
 src/bootchart/bootchart.c | 4 ++--
84b277
 1 file changed, 2 insertions(+), 2 deletions(-)
84b277
84b277
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
84b277
index 14ccd3e..4a8d6c2 100644
84b277
--- a/src/bootchart/bootchart.c
84b277
+++ b/src/bootchart/bootchart.c
84b277
@@ -346,8 +346,8 @@ int main(int argc, char *argv[]) {
84b277
 
84b277
                 sampledata = new0(struct list_sample_data, 1);
84b277
                 if (sampledata == NULL) {
84b277
-                        log_error("Failed to allocate memory for a node: %m");
84b277
-                        return -1;
84b277
+                        log_oom();
84b277
+                        return EXIT_FAILURE;
84b277
                 }
84b277
 
84b277
                 sampledata->sampletime = gettime_ns();