condense assignment and path_kill_slashes calls
authorDave Reisner <dreisner@archlinux.org>
Wed, 16 Apr 2014 02:16:40 +0000 (22:16 -0400)
committerDave Reisner <dreisner@archlinux.org>
Mon, 21 Apr 2014 13:52:08 +0000 (09:52 -0400)
src/shared/cgroup-util.c
src/shared/path-util.c

index 9d50890..139888c 100644 (file)
@@ -472,9 +472,7 @@ static int join_path(const char *controller, const char *path, const char *suffi
         if (!t)
                 return -ENOMEM;
 
-        path_kill_slashes(t);
-
-        *fs = t;
+        *fs = path_kill_slashes(t);
         return 0;
 }
 
@@ -957,8 +955,7 @@ int cg_split_spec(const char *spec, char **controller, char **path) {
                         if (!t)
                                 return -ENOMEM;
 
-                        path_kill_slashes(t);
-                        *path = t;
+                        *path = path_kill_slashes(t);
                 }
 
                 if (controller)
@@ -1048,8 +1045,7 @@ int cg_mangle_path(const char *path, char **result) {
                 if (!t)
                         return -ENOMEM;
 
-                path_kill_slashes(t);
-                *result = t;
+                *result = path_kill_slashes(t);
                 return 0;
         }
 
index e35d7f8..373dd7a 100644 (file)
@@ -464,8 +464,7 @@ int find_binary(const char *name, char **filename) {
                                 continue;
 
                         if (filename) {
-                                path_kill_slashes(p);
-                                *filename = p;
+                                *filename = path_kill_slashes(p);
                                 p = NULL;
                         }