[systemd-commits] 2 commits - src/boot src/shared

David Herrmann dvdhrm at kemper.freedesktop.org
Thu Mar 19 06:42:17 PDT 2015


 src/boot/bootctl.c |    4 ----
 src/shared/strv.c  |    3 ++-
 src/shared/strv.h  |    2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit 33c2ce7b200747c172d4899c717a8e9097d84659
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Tue Mar 17 12:20:31 2015 +0100

    strv: return NULL from strv_free()
    
    We always return NULL/invalid-object from destructors, fix strv_free() to
    do the same.

diff --git a/src/shared/strv.c b/src/shared/strv.c
index ee45ad1..8c6ba6a 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -80,9 +80,10 @@ void strv_clear(char **l) {
         *l = NULL;
 }
 
-void strv_free(char **l) {
+char **strv_free(char **l) {
         strv_clear(l);
         free(l);
+        return NULL;
 }
 
 char **strv_copy(char * const *l) {
diff --git a/src/shared/strv.h b/src/shared/strv.h
index 518c4c2..a80ccd6 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -31,7 +31,7 @@ char *strv_find(char **l, const char *name) _pure_;
 char *strv_find_prefix(char **l, const char *name) _pure_;
 char *strv_find_startswith(char **l, const char *name) _pure_;
 
-void strv_free(char **l);
+char **strv_free(char **l);
 DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
 #define _cleanup_strv_free_ _cleanup_(strv_freep)
 

commit e0d065d4059181bfbf0aba81f780d32ba194c319
Author: David Herrmann <dh.herrmann at gmail.com>
Date:   Mon Mar 16 21:07:38 2015 +0100

    bootctl: drop redundant parse_argv()
    
    We already call parse_argv() from main(), don't call it here again.

diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index ae467ca..bc14051 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -1285,10 +1285,6 @@ static int bootctl_main(int argc, char*argv[]) {
         int q;
         int r;
 
-        r = parse_argv(argc, argv);
-        if (r <= 0)
-                goto finish;
-
         if (argv[optind]) {
                 for (i = 0; i < ELEMENTSOF(verbs); i++) {
                         if (!streq(argv[optind], verbs[i].verb))



More information about the systemd-commits mailing list