salimma / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
2d15635
From 704dd9ab74b4c619be23e9b50f3990000f84ddf3 Mon Sep 17 00:00:00 2001
2d15635
From: Lennart Poettering <lennart@poettering.net>
2d15635
Date: Mon, 11 Aug 2014 18:23:47 +0200
2d15635
Subject: [PATCH] bootchart: it's not OK to return -1 from a main program
2d15635
2d15635
(cherry picked from commit 4155f7d4be5053d5f34a26e5437fd85e1fe00fa3)
2d15635
---
2d15635
 src/bootchart/bootchart.c | 4 ++--
2d15635
 1 file changed, 2 insertions(+), 2 deletions(-)
2d15635
2d15635
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
2d15635
index 9f99c1f6b1..eadf17c357 100644
2d15635
--- a/src/bootchart/bootchart.c
2d15635
+++ b/src/bootchart/bootchart.c
2d15635
@@ -346,8 +346,8 @@ int main(int argc, char *argv[]) {
2d15635
 
2d15635
                 sampledata = new0(struct list_sample_data, 1);
2d15635
                 if (sampledata == NULL) {
2d15635
-                        log_error("Failed to allocate memory for a node: %m");
2d15635
-                        return -1;
2d15635
+                        log_oom();
2d15635
+                        return EXIT_FAILURE;
2d15635
                 }
2d15635
 
2d15635
                 sampledata->sampletime = gettime_ns();