chiark / gitweb /
namespace: add missing 'const' to parameters
[elogind.git] / src / core / namespace.c
index eaaebdd64403734c02be7a55974a50827b8a79bf..ab03aebf5b5dd9209a3c32b60c32be94eee94599 100644 (file)
@@ -263,11 +263,8 @@ fail:
         if (devmqueue)
                 umount(devmqueue);
 
-        if (dev) {
-                umount(dev);
-                rmdir(dev);
-        }
-
+        umount(dev);
+        rmdir(dev);
         rmdir(temporary_mount);
 
         return r;
@@ -278,7 +275,7 @@ static int mount_kdbus(BindMount *m) {
         char temporary_mount[] = "/tmp/kdbus-dev-XXXXXX";
         _cleanup_free_ char *basepath = NULL;
         _cleanup_umask_ mode_t u;
-        char *busnode, *root;
+        char *busnode = NULL, *root;
         struct stat st;
         int r;
 
@@ -341,11 +338,8 @@ fail:
                 unlink(busnode);
         }
 
-        if (root) {
-                umount(root);
-                rmdir(root);
-        }
-
+        umount(root);
+        rmdir(root);
         rmdir(temporary_mount);
 
         return r;
@@ -430,9 +424,9 @@ int setup_namespace(
                 char** read_write_dirs,
                 char** read_only_dirs,
                 char** inaccessible_dirs,
-                char* tmp_dir,
-                char* var_tmp_dir,
-                char* bus_endpoint_path,
+                const char* tmp_dir,
+                const char* var_tmp_dir,
+                const char* bus_endpoint_path,
                 bool private_dev,
                 ProtectHome protect_home,
                 ProtectSystem protect_system,