[systemd-commits] 3 commits - Makefile.am src/systemctl.c

Lennart Poettering lennart at kemper.freedesktop.org
Tue Jun 14 13:01:51 PDT 2011


 Makefile.am     |    3 +--
 src/systemctl.c |   16 +++++++++-------
 2 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 5552b1c1b39cc73fe7201b31e79d1a05c3d0cee0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue Jun 14 22:01:44 2011 +0200

    build-sys: fix build

diff --git a/Makefile.am b/Makefile.am
index ee16f98..ded325a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -244,6 +244,7 @@ dist_systemunit_DATA = \
 	units/halt.target \
 	units/kexec.target \
 	units/local-fs.target \
+	units/remote-fs.target \
 	units/cryptsetup.target \
 	units/network.target \
 	units/nss-lookup.target \
@@ -301,7 +302,6 @@ nodist_systemunit_DATA = \
 	units/getty at .service \
 	units/serial-getty at .service \
 	units/console-shell.service \
-	units/remote-fs.target \
 	units/systemd-initctl.service \
 	units/systemd-logger.service \
 	units/systemd-shutdownd.service \
@@ -349,7 +349,6 @@ EXTRA_DIST = \
 	units/getty at .service.m4 \
 	units/serial-getty at .service.m4 \
 	units/console-shell.service.m4 \
-	units/remote-fs.target.m4 \
 	units/rescue.service.m4 \
 	units/systemd-initctl.service.in \
 	units/systemd-logger.service.in \

commit b647f10da7c7e737ad8f5193cb1ca5dc3c2b5d45
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Mon Jun 13 14:19:53 2011 +0200

    systemctl: fix a FILE* leak
    
    In practice it does not really matter, but let's be nice and close the
    file.

diff --git a/src/systemctl.c b/src/systemctl.c
index 889e3ee..2bd173c 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4172,8 +4172,10 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
         if (streq(verb, "is-enabled") &&
             strv_isempty(i->aliases) &&
             strv_isempty(i->wanted_by) &&
-            !path_startswith(filename, "/etc"))
+            !path_startswith(filename, "/etc")) {
+                fclose(f);
                 return 1;
+        }
 
         n_symlinks += strv_length(i->aliases);
         n_symlinks += strv_length(i->wanted_by);

commit b77398f7a05aa313cebcea81e9381833bede2d61
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Mon Jun 13 14:19:47 2011 +0200

    systemctl: fix 'is-enabled' for native units under /lib
    
    The units always showed up as enabled.
    
    The config file has to be parsed before we can check what's in
    the [Install] section.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=699027

diff --git a/src/systemctl.c b/src/systemctl.c
index faca797..889e3ee 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -4160,6 +4160,13 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
                 return -ENOENT;
         }
 
+        i->path = filename;
+
+        if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
+                fclose(f);
+                return r;
+        }
+
         /* Consider unit files stored in /lib and /usr always enabled
          * if they have no [Install] data. */
         if (streq(verb, "is-enabled") &&
@@ -4168,13 +4175,6 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
             !path_startswith(filename, "/etc"))
                 return 1;
 
-        i->path = filename;
-
-        if ((r = config_parse(filename, f, NULL, items, true, i)) < 0) {
-                fclose(f);
-                return r;
-        }
-
         n_symlinks += strv_length(i->aliases);
         n_symlinks += strv_length(i->wanted_by);
 



More information about the systemd-commits mailing list