Dump the log after loading it from the slave (dump_log): Set first_old to

2001-06-20  Bradford Hovinen  <hovinen@ximian.com>

	* config-log.c (slave_data_cb): Dump the log after loading it from
	the slave
	(dump_log): Set first_old to the beginning of the list after the dump
	(do_load): Don't call do_unload
	(socket_data_cb): Check for hang up first
	(do_load): Don't call reset_filenames

	* archive.c, Makefile.am: Replace all instances of ximian-config
	with ximian-setup-tools

	* config-log.c (slave_new): Don't apprise slave of new data
	(config_log_write_entry): Dump log after every write
This commit is contained in:
Bradford Hovinen 2001-06-20 17:58:45 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent 3f08be4e57
commit 1f701fce3b
3 changed files with 12 additions and 5 deletions

View file

@ -5,6 +5,7 @@
(dump_log): Set first_old to the beginning of the list after the dump (dump_log): Set first_old to the beginning of the list after the dump
(do_load): Don't call do_unload (do_load): Don't call do_unload
(socket_data_cb): Check for hang up first (socket_data_cb): Check for hang up first
(do_load): Don't call reset_filenames
* archive.c, Makefile.am: Replace all instances of ximian-config * archive.c, Makefile.am: Replace all instances of ximian-config
with ximian-setup-tools with ximian-setup-tools

View file

@ -331,6 +331,7 @@ config_log_open (Location *location)
"location", location, "location", location,
NULL); NULL);
config_log_reset_filenames (CONFIG_LOG (object));
do_load (CONFIG_LOG (object)); do_load (CONFIG_LOG (object));
connect_socket (CONFIG_LOG (object)); connect_socket (CONFIG_LOG (object));
@ -635,6 +636,7 @@ config_log_reload (ConfigLog *config_log)
g_return_if_fail (IS_CONFIG_LOG (config_log)); g_return_if_fail (IS_CONFIG_LOG (config_log));
do_unload (config_log, FALSE); do_unload (config_log, FALSE);
config_log_reset_filenames (config_log);
do_load (config_log); do_load (config_log);
} }
@ -891,17 +893,13 @@ do_load (ConfigLog *config_log)
g_return_val_if_fail (config_log->p->location != NULL, FALSE); g_return_val_if_fail (config_log->p->location != NULL, FALSE);
g_return_val_if_fail (IS_LOCATION (config_log->p->location), FALSE); g_return_val_if_fail (IS_LOCATION (config_log->p->location), FALSE);
config_log_reset_filenames (config_log);
fd = open (config_log->p->filename, O_RDONLY); fd = open (config_log->p->filename, O_RDONLY);
if (fd != -1) if (fd != -1)
config_log->p->file_buffer = config_log->p->file_buffer =
io_buffer_new (g_io_channel_unix_new (fd), FALSE); io_buffer_new (g_io_channel_unix_new (fd), FALSE);
else { else
g_warning ("Could not open config log: %s", g_strerror (errno));
config_log->p->file_buffer = NULL; config_log->p->file_buffer = NULL;
}
return TRUE; return TRUE;
} }

View file

@ -525,6 +525,13 @@ location_store (Location *location, gchar *backend_id, FILE *input,
if (doc_str->len > 0) { if (doc_str->len > 0) {
doc = xmlParseDoc (doc_str->str); doc = xmlParseDoc (doc_str->str);
if (doc == NULL) {
g_warning ("Could not parse XML");
g_string_free (doc_str, TRUE);
return;
}
location_store_xml (location, backend_id, doc, store_type); location_store_xml (location, backend_id, doc, store_type);
xmlFreeDoc (doc); xmlFreeDoc (doc);
} else { } else {
@ -562,6 +569,7 @@ location_store_xml (Location *location, gchar *backend_id, xmlDocPtr xml_doc,
g_return_if_fail (IS_LOCATION (location)); g_return_if_fail (IS_LOCATION (location));
g_return_if_fail (location->p->config_log != NULL); g_return_if_fail (location->p->config_log != NULL);
g_return_if_fail (IS_CONFIG_LOG (location->p->config_log)); g_return_if_fail (IS_CONFIG_LOG (location->p->config_log));
g_return_if_fail (xml_doc != NULL);
contain_type = location_contains (location, backend_id); contain_type = location_contains (location, backend_id);