 +			int ret; 
 +			
 +			/* Really commit to the Key database */
-+			kdbOpen();
++			kdbOpen(&handle);
 +			fprintf(stderr,"Writing X.org configuration keys to %s\n",rootkey);
 +			ksRewind(ks);
-+			ret=kdbSetKeys(ks);
++			ret=kdbSetKeys(handle, ks);
 +			if (ret != 0) {
 +				Key *problem;
 +				char error[500];

+		snprintf(buffer, size, "%s/Options", keyStealName(current));
+
+		ksInit(settings);
+		kdbGetChildKeys(buffer,settings,KDB_O_SORT);
+		if (ksGetSize(settings))
+			monitor->mon_option_lst=ksToOptions(settings);
+

+		buffer = xf86confmalloc((size = 100));
+				
+		settings = ksNew();
+		kdbGetKeyChildKeys(handle, key, settings, 0);
+		
+		/* Get Viewport.x */
+		snprintf(buffer, size, "%s/Viewport.x", keyStealName(key));
