chiark / gitweb /
systemctl: more cleanup
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Fri, 16 May 2014 21:37:54 +0000 (23:37 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 17 May 2014 06:41:37 +0000 (08:41 +0200)
This is followup on 05cae7f3431446236139434ee58a6275f3cb31e8

I think the intention was to use the newly introduced 'path'
variable in the inner loop instead of p.

src/systemctl/systemctl.c

index 2fa8ecc6644fd567494e1d912f0f0472aceca973..6e98c05152dfaaadc01920e18db5b79c82e5403e 100644 (file)
@@ -5030,16 +5030,16 @@ static int enable_sysv_units(const char *verb, char **args) {
                         _cleanup_free_ char *path = NULL;
 
                         if (!isempty(arg_root))
-                                asprintf(&p, "%s/%s/%s", arg_root, *k, name);
+                                asprintf(&path, "%s/%s/%s", arg_root, *k, name);
                         else
-                                asprintf(&p, "%s/%s", *k, name);
+                                asprintf(&path, "%s/%s", *k, name);
 
-                        if (!p) {
+                        if (!path) {
                                 r = log_oom();
                                 goto finish;
                         }
 
-                        found_native = access(p, F_OK) >= 0;
+                        found_native = access(path, F_OK) >= 0;
                         if (found_native)
                                 break;
                 }