From 93e004a93f691d5b27c875f89806ff3c03383872 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Thu, 21 Jun 2001 14:33:24 +0000 Subject: [PATCH] Don't call close on fd (dump_log): Use g_critical on error conditions 2001-06-21 Bradford Hovinen * config-log.c (dump_log): Don't call close on fd (dump_log): Use g_critical on error conditions rather than g_warning --- archiver/ChangeLog | 5 +++++ archiver/config-log.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 8123824e2..3bf25991e 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,3 +1,8 @@ +2001-06-21 Bradford Hovinen + + * 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 * config-log.c (slave_data_cb): Dump the log after loading it from diff --git a/archiver/config-log.c b/archiver/config-log.c index 9eda46176..ebe64d69c 100644 --- a/archiver/config-log.c +++ b/archiver/config-log.c @@ -1030,8 +1030,8 @@ dump_log (ConfigLog *config_log) out_fd = open (filename_out, O_CREAT | O_WRONLY | O_TRUNC, 0600); if (out_fd == -1) { - g_warning ("Could not open output file: %s", - g_strerror (errno)); + g_critical ("Could not open output file: %s", + g_strerror (errno)); return; } @@ -1050,7 +1050,6 @@ dump_log (ConfigLog *config_log) } io_buffer_destroy (output); - close (out_fd); if (config_log->p->filename) rename (filename_out, config_log->p->filename); @@ -1058,6 +1057,11 @@ dump_log (ConfigLog *config_log) 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 has_nondefaults (ConfigLog *config_log) {