diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 1d849b548..c77f6f813 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,7 @@ +2001-06-18 Bradford Hovinen + + * config-log.c (slave_data_cb): Don't use == to test IO conditions + 2001-06-01 Bradford Hovinen * location.c (run_backend_proc): Don't free path string after diff --git a/archiver/config-log.c b/archiver/config-log.c index da87b12ad..8ea85bc29 100644 --- a/archiver/config-log.c +++ b/archiver/config-log.c @@ -1334,11 +1334,13 @@ slave_data_cb (GIOChannel *channel, GIOCondition condition, g_return_val_if_fail (slave->config_log != NULL, FALSE); g_return_val_if_fail (IS_CONFIG_LOG (slave->config_log), FALSE); - if (condition == G_IO_HUP || slave->buffer->closed) { + DEBUG_MSG ("Condition is %d", condition); + + if (condition & G_IO_HUP || slave->buffer->closed) { slave_destroy (slave); return FALSE; } - else if (condition == G_IO_IN) { + else if (condition & G_IO_IN) { if (load_log_entry (slave->config_log, TRUE, slave->buffer, NULL) != NULL) slave_broadcast_data (slave, slave->config_log); diff --git a/archiver/location.c b/archiver/location.c index 8d01187e8..ede82917e 100644 --- a/archiver/location.c +++ b/archiver/location.c @@ -411,7 +411,19 @@ location_do_rollback (Location *location, gchar *backend_id, xmlDocPtr doc) output = fdopen (fd, "w"); xmlDocDump (output, doc); - fclose (output); + + DEBUG_MSG ("Done dumping data; flushing and closing output stream"); + + if (fflush (output) == EOF) { + g_critical ("%s: Could not dump buffer: %s", + __FUNCTION__, g_strerror (errno)); + } + + if (fclose (output) == EOF) { + g_critical ("%s: Could not close output stream: %s", + __FUNCTION__, g_strerror (errno)); + return FALSE; + } return TRUE; }