systemctl: do not return uninitialized r
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sun, 22 Nov 2015 22:10:26 +0000 (23:10 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sun, 22 Nov 2015 22:11:20 +0000 (23:11 +0100)
Regresssed during port to extract_first_word in
5ab22f3321d238957c03dcc6a6db76491e3989b8

CID #1338060

src/systemctl/systemctl.c

index 240fa2c..f478d80 100644 (file)
@@ -6550,8 +6550,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         return version();
 
                 case 't': {
-                        if (isempty(optarg))
-                                return log_error_errno(r, "--type requires arguments.");
+                        if (isempty(optarg)) {
+                                log_error("--type requires arguments.");
+                                return -EINVAL;
+                        }
 
                         p = optarg;
                         for(;;) {
@@ -6783,8 +6785,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_STATE: {
-                        if (isempty(optarg))
-                                return log_error_errno(r, "--signal requires arguments.");
+                        if (isempty(optarg)) {
+                                log_error("--signal requires arguments.");
+                                return -EINVAL;
+                        }
 
                         p = optarg;
                         for(;;) {