]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/modules-load/modules-load.c
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / modules-load / modules-load.c
index 5f678789ce0024185c1bc25c491cd3185742f9e3..4a58ce10823c529b80a92cb0787f8a28761baecc 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <unistd.h>
-#include <fcntl.h>
 #include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <limits.h>
-#include <dirent.h>
 #include <getopt.h>
 #include <libkmod.h>
+#include <limits.h>
+#include <string.h>
+#include <sys/stat.h>
 
+#include "conf-files.h"
 #include "log.h"
-#include "util.h"
+#include "string-util.h"
 #include "strv.h"
-#include "conf-files.h"
-#include "fileio.h"
-#include "build.h"
+#include "util.h"
 
 static char **arg_proc_cmdline_modules = NULL;
 
@@ -55,7 +51,7 @@ static int add_modules(const char *p) {
         if (!k)
                 return log_oom();
 
-        if (strv_extend_strv(&arg_proc_cmdline_modules, k) < 0)
+        if (strv_extend_strv(&arg_proc_cmdline_modules, k, true) < 0)
                 return log_oom();
 
         return 0;
@@ -203,9 +199,7 @@ static int parse_argv(int argc, char *argv[]) {
                         return 0;
 
                 case ARG_VERSION:
-                        puts(PACKAGE_STRING);
-                        puts(SYSTEMD_FEATURES);
-                        return 0;
+                        return version();
 
                 case '?':
                         return -EINVAL;
@@ -256,7 +250,7 @@ int main(int argc, char *argv[]) {
                 }
 
         } else {
-                _cleanup_free_ char **files = NULL;
+                _cleanup_strv_free_ char **files = NULL;
                 char **fn, **i;
 
                 STRV_FOREACH(i, arg_proc_cmdline_modules) {