[systemd-commits] 3 commits - NEWS src/cryptsetup

Lennart Poettering lennart at kemper.freedesktop.org
Mon Mar 25 16:22:02 PDT 2013


 NEWS                                  |    5 ++++-
 src/cryptsetup/cryptsetup-generator.c |   33 +++++++--------------------------
 2 files changed, 11 insertions(+), 27 deletions(-)

New commits:
commit e32530cbef746a3d346334a821a7c804f49af4e6
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 25 23:49:41 2013 +0100

    cryptsetup-generator: let's be a bit more efficient with strv_extend()

diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 5c4a280..8959bf5 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -258,26 +258,14 @@ static int parse_proc_cmdline(char ***arg_proc_cmdline_disks) {
                         }
 
                 } else if (startswith(word, "luks.uuid=")) {
-                        char **t;
-
-                        t = strv_append(*arg_proc_cmdline_disks, word + 10);
-                        if (!t)
+                        if (strv_extend(arg_proc_cmdline_disks, word + 10) < 0)
                                 return log_oom();
 
-                        strv_free(*arg_proc_cmdline_disks);
-                        *arg_proc_cmdline_disks = t;
-
                 } else if (startswith(word, "rd.luks.uuid=")) {
 
                         if (in_initrd()) {
-                                char **t;
-
-                                t = strv_append(*arg_proc_cmdline_disks, word + 13);
-                                if (!t)
+                                if (strv_extend(arg_proc_cmdline_disks, word + 13) < 0)
                                         return log_oom();
-
-                                strv_free(*arg_proc_cmdline_disks);
-                                *arg_proc_cmdline_disks = t;
                         }
 
                 } else if (startswith(word, "luks.") ||
@@ -370,17 +358,11 @@ int main(int argc, char *argv[]) {
                                                 return log_oom();
 
                                         if (streq(proc_device, device) || streq(proc_name, name)) {
-                                                char **t;
-
                                                 if (create_disk(name, device, password, options) < 0)
                                                         r = EXIT_FAILURE;
 
-                                                t = strv_append(arg_proc_cmdline_disks_done, p);
-                                                if (!t)
+                                                if (strv_extend(&arg_proc_cmdline_disks_done, p) < 0)
                                                         return log_oom();
-
-                                                strv_free(arg_proc_cmdline_disks_done);
-                                                arg_proc_cmdline_disks_done = t;
                                         }
                                 }
                         } else {

commit 608d41f355d580a6f73e76b298bfc1b4e3155b80
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 25 23:49:13 2013 +0100

    cryptsetup-generator: add a missing OOM check

diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 0a51db8..5c4a280 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -169,8 +169,6 @@ static int create_disk(
                 }
 
                 free(to);
-                to = NULL;
-
                 if (!nofail)
                         to = strjoin(arg_dest, "/cryptsetup.target.requires/", n, NULL);
                 else
@@ -183,12 +181,13 @@ static int create_disk(
                         log_error("Failed to create symlink '%s' to '%s': %m", from, to);
                         return -errno;
                 }
-
-                free(to);
-                to = NULL;
         }
 
         e = unit_name_escape(name);
+        if (!e)
+                return log_oom();
+
+        free(to);
         to = strjoin(arg_dest, "/dev-mapper-", e, ".device.requires/", n, NULL);
         if (!to)
                 return log_oom();

commit 6a7d3d68bf1ae9bcdaa3a17bc76f72bb7b988ec4
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Mar 25 23:48:08 2013 +0100

    update NEWS

diff --git a/NEWS b/NEWS
index 8815ce9..b2011cd 100644
--- a/NEWS
+++ b/NEWS
@@ -34,7 +34,7 @@ CHANGES WITH 199:
 
         * journald will not explicitly flush the journal files to disk
           the latest 5min after each write. This will also mark the
-          files as offline then until the next read. This should
+          files as offline then until the next write. This should
           increase reliability. The synchronization delay can be
           configured via SyncIntervalSec= in journald.conf.
 
@@ -47,6 +47,9 @@ CHANGES WITH 199:
           from. This complements sockets.target with a similar
           purpose for socket units.
 
+        * libudev gained a new call udev_device_set_attribute_value()
+          to set sysfs attributes of a device.
+
         Contributions from: Auke Kok, Colin Walters, Cristian
         Rodríguez, Daniel Buch, Dave Reisner, Frederic Crozat, Hannes
         Reinecke, Harald Hoyer, Jan Alexander Steffens, Jan



More information about the systemd-commits mailing list