[systemd-commits] 4 commits - src/bootchart src/initctl src/journal-remote

Lennart Poettering lennart at kemper.freedesktop.org
Mon Aug 11 09:24:48 PDT 2014


 src/bootchart/bootchart.c           |    4 ++--
 src/bootchart/svg.c                 |   10 +++++-----
 src/initctl/initctl.c               |    2 +-
 src/journal-remote/journal-remote.c |    6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit d7bf74d9cccdc6ffa567ea0e08f814863610f88e
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 11 18:24:43 2014 +0200

    journal-remote: fix parsing of fd command line argument

diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index c8e3c23..36c8e00 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -795,11 +795,12 @@ static int fd_fd(const char *spec) {
         r = safe_atoi(spec, &fd);
         if (r < 0)
                 return r;
+        if (fd < 0)
+                return -EINVAL;
 
-        return -1;
+        return fd;
 }
 
-
 static int remoteserver_init(RemoteServer *s,
                              const char* key,
                              const char* cert,
@@ -809,7 +810,6 @@ static int remoteserver_init(RemoteServer *s,
 
         assert(s);
 
-
         if ((arg_listen_raw || arg_listen_http) && trust) {
                 log_error("Option --trust makes all non-HTTPS connections untrusted.");
                 return -EINVAL;

commit fd006cce3861ce8321149dfd9210d65639e5e1dc
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 11 18:24:28 2014 +0200

    initctl: don't eat up error code

diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index f3f6f73..0954e58 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -218,7 +218,7 @@ static int fifo_process(Fifo *f) {
                         return 0;
 
                 log_warning("Failed to read from fifo: %m");
-                return -1;
+                return -errno;
         }
 
         f->bytes_read += l;

commit a2715692e22647428cceba3d4c300a85ddd4fadf
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 11 18:24:08 2014 +0200

    bootchart: use the bool type where appropriate

diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index bf6636c..135883f 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -881,21 +881,21 @@ static struct ps_struct *get_next_ps(struct ps_struct *ps) {
         return NULL;
 }
 
-static int ps_filter(struct ps_struct *ps) {
+static bool ps_filter(struct ps_struct *ps) {
         if (!arg_filter)
-                return 0;
+                return false;
 
         /* can't draw data when there is only 1 sample (need start + stop) */
         if (ps->first == ps->last)
-                return -1;
+                return true;
 
         /* don't filter kthreadd */
         if (ps->pid == 2)
-                return 0;
+                return false;
 
         /* drop stuff that doesn't use any real CPU time */
         if (ps->total <= 0.001)
-                return -1;
+                return true;
 
         return 0;
 }

commit 4155f7d4be5053d5f34a26e5437fd85e1fe00fa3
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Aug 11 18:23:47 2014 +0200

    bootchart: it's not OK to return -1 from a main program

diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index c0e176d..8ef5ad1 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -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();



More information about the systemd-commits mailing list