[dconf] dconf update: don't attempt to open non-files



commit 9bf809f5015576b6903a80d819ab61a1d4846913
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu May 5 14:22:52 2011 +0200

    dconf update: don't attempt to open non-files

 bin/dconf-update.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/bin/dconf-update.vala b/bin/dconf-update.vala
index 911b8aa..a30ce4b 100644
--- a/bin/dconf-update.vala
+++ b/bin/dconf-update.vala
@@ -50,6 +50,12 @@ Gvdb.HashTable read_directory (string dirname) throws GLib.Error {
 	var dir = Dir.open (dirname);
 	while ((name = dir.read_name ()) != null) {
 		var filename = Path.build_filename (dirname, name);
+		Posix.Stat buf;
+
+		// only 'normal' files
+		if (Posix.stat (filename, out buf) < 0 || !Posix.S_ISREG (buf.st_mode)) {
+			continue;
+		}
 
 		var kf = new KeyFile ();
 



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