[rygel] core: Fix config dir creation



commit 7d697ca20c54a36418612317a39138aad97a0e1e
Author: Jens Georg <mail jensge org>
Date:   Wed Aug 24 20:36:13 2016 +0200

    core: Fix config dir creation
    
    Signed-off-by: Jens Georg <mail jensge org>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770276

 src/librygel-core/rygel-description-file.vala    |    3 +--
 src/librygel-core/rygel-root-device-factory.vala |    5 +----
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/librygel-core/rygel-description-file.vala b/src/librygel-core/rygel-description-file.vala
index eb1a917..c8c1959 100644
--- a/src/librygel-core/rygel-description-file.vala
+++ b/src/librygel-core/rygel-description-file.vala
@@ -501,8 +501,7 @@ public class Rygel.DescriptionFile : Object {
             throw new IOError.FAILED (message, path);
         }
 
-        // Make sure we don't have any newlines
-        file.puts (mem.replace ("\n", ""));
+        FileUtils.set_contents (path, mem.replace ("\n", ""));
     }
 
     private int index_of_device_element (string element) {
diff --git a/src/librygel-core/rygel-root-device-factory.vala 
b/src/librygel-core/rygel-root-device-factory.vala
index 914842f..5e8fe36 100644
--- a/src/librygel-core/rygel-root-device-factory.vala
+++ b/src/librygel-core/rygel-root-device-factory.vala
@@ -241,9 +241,6 @@ public class Rygel.RootDeviceFactory : Object,
     }
 
     private void ensure_dir_exists (string dir_path) throws Error {
-        var file = File.new_for_path (dir_path);
-        if (!file.query_exists (null)) {
-            file.make_directory (null);
-        }
+        DirUtils.create_with_parents (dir_path, 0750);
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]