summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2016-08-24 20:36:13 +0200
committerJens Georg <mail@jensge.org>2016-08-24 20:39:09 +0200
commit7d697ca20c54a36418612317a39138aad97a0e1e (patch)
tree08616550a22a3be2033e5d94ffa5de57cfc39d07
parentf98d5a30e5e74ba83c1a2258e8a3096748ef7048 (diff)
downloadrygel-7d697ca20c54a36418612317a39138aad97a0e1e.tar.gz
core: Fix config dir creation
Signed-off-by: Jens Georg <mail@jensge.org> https://bugzilla.gnome.org/show_bug.cgi?id=770276
-rw-r--r--src/librygel-core/rygel-description-file.vala3
-rw-r--r--src/librygel-core/rygel-root-device-factory.vala5
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 eb1a9172..c8c19593 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 914842f6..5e8fe36f 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);
}
}