chiark / gitweb /
machine-id-commit: simplifications
authorLennart Poettering <lennart@poettering.net>
Tue, 10 Mar 2015 17:56:56 +0000 (18:56 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 10 Mar 2015 17:56:56 +0000 (18:56 +0100)
src/machine-id-commit/machine-id-commit.c

index d9c1b7c..0f7748e 100644 (file)
@@ -28,7 +28,7 @@
 #include "log.h"
 #include "build.h"
 
-static const char *arg_root = "";
+static const char *arg_root = NULL;
 
 static void help(void) {
         printf("%s [OPTIONS...]\n\n"
@@ -98,7 +98,10 @@ int main(int argc, char *argv[]) {
 
         r = parse_argv(argc, argv);
         if (r <= 0)
-                return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+                goto finish;
 
-        return machine_id_commit(arg_root) < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
+        r = machine_id_commit(arg_root);
+
+finish:
+        return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
 }