[systemd-commits] 2 commits - src/mount-setup.c src/strv.c

Lennart Poettering lennart at kemper.freedesktop.org
Tue Apr 26 12:25:01 PDT 2011


 src/mount-setup.c |    6 ++++--
 src/strv.c        |    4 ++--
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit aa4355f295c76704baec08509e80fcb827c023da
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Apr 26 21:23:56 2011 +0200

    strv: Fix gcc unitialized variable warning
    
    Since strv_* functions handle null arguments, this warning is actually
    valid.
    
    src/strv.c: In function ‘strv_copy’:
    src/strv.c:68:21: warning: ‘k’ may be used uninitialized in this function [-Wuninitialized]

diff --git a/src/strv.c b/src/strv.c
index 71b77c9..f15aa87 100644
--- a/src/strv.c
+++ b/src/strv.c
@@ -67,11 +67,11 @@ void strv_free(char **l) {
 char **strv_copy(char **l) {
         char **r, **k;
 
-        if (!(r = new(char*, strv_length(l)+1)))
+        if (!(k = r = new(char*, strv_length(l)+1)))
                 return NULL;
 
         if (l)
-                for (k = r; *l; k++, l++)
+                for (; *l; k++, l++)
                         if (!(*k = strdup(*l)))
                                 goto fail;
 

commit 016e9849e03c1375a09c11c54ad06a61f6a24473
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Apr 26 21:12:36 2011 +0200

    mount: failure to mount cgroup hierarchies should not be fatal
    
    If we cannot open /etc/cgroup, print an error message, but go on, to
    support cgroup-less builds.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=628004

diff --git a/src/mount-setup.c b/src/mount-setup.c
index 77be8fe..48c32ea 100644
--- a/src/mount-setup.c
+++ b/src/mount-setup.c
@@ -136,8 +136,10 @@ static int mount_cgroup_controllers(void) {
 
         /* Mount all available cgroup controllers that are built into the kernel. */
 
-        if (!(f = fopen("/proc/cgroups", "re")))
-                return -ENOENT;
+        if (!(f = fopen("/proc/cgroups", "re"))) {
+                log_error("Failed to enumerate cgroup controllers: %m");
+                return 0;
+        }
 
         /* Ignore the header line */
         (void) fgets(buf, sizeof(buf), f);



More information about the systemd-commits mailing list