chiark / gitweb /
bootchart: it's not OK to return -1 from a main program
authorLennart Poettering <lennart@poettering.net>
Mon, 11 Aug 2014 16:23:47 +0000 (18:23 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 11 Aug 2014 16:23:47 +0000 (18:23 +0200)
src/bootchart/bootchart.c

index c0e176d..8ef5ad1 100644 (file)
@@ -380,8 +380,8 @@ int main(int argc, char *argv[]) {
 
                 sampledata = new0(struct list_sample_data, 1);
                 if (sampledata == NULL) {
-                        log_error("Failed to allocate memory for a node: %m");
-                        return -1;
+                        log_oom();
+                        return EXIT_FAILURE;
                 }
 
                 sampledata->sampletime = gettime_ns();