Don't call close on fd (dump_log): Use g_critical on error conditions

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

	* config-log.c (dump_log): Don't call close on fd
	(dump_log): Use g_critical on error conditions rather than g_warning
This commit is contained in:
Bradford Hovinen 2001-06-21 14:33:24 +00:00 committed by Bradford Hovinen (Gdict maintainer)
parent f707e7350e
commit 93e004a93f
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2001-06-21 Bradford Hovinen <hovinen@ximian.com>
* config-log.c (dump_log): Don't call close on fd
(dump_log): Use g_critical on error conditions rather than g_warning
2001-06-20 Bradford Hovinen <hovinen@ximian.com> 2001-06-20 Bradford Hovinen <hovinen@ximian.com>
* config-log.c (slave_data_cb): Dump the log after loading it from * config-log.c (slave_data_cb): Dump the log after loading it from

View file

@ -1030,8 +1030,8 @@ dump_log (ConfigLog *config_log)
out_fd = open (filename_out, O_CREAT | O_WRONLY | O_TRUNC, 0600); out_fd = open (filename_out, O_CREAT | O_WRONLY | O_TRUNC, 0600);
if (out_fd == -1) { if (out_fd == -1) {
g_warning ("Could not open output file: %s", g_critical ("Could not open output file: %s",
g_strerror (errno)); g_strerror (errno));
return; return;
} }
@ -1050,7 +1050,6 @@ dump_log (ConfigLog *config_log)
} }
io_buffer_destroy (output); io_buffer_destroy (output);
close (out_fd);
if (config_log->p->filename) if (config_log->p->filename)
rename (filename_out, config_log->p->filename); rename (filename_out, config_log->p->filename);
@ -1058,6 +1057,11 @@ dump_log (ConfigLog *config_log)
DEBUG_MSG ("Exit"); DEBUG_MSG ("Exit");
} }
/* Return TRUE if the config log has entries made by actual configuration
* changes, as opposed to default values placed there when the location was
* initialized
*/
static gboolean static gboolean
has_nondefaults (ConfigLog *config_log) has_nondefaults (ConfigLog *config_log)
{ {