[gnome-commander] Code cleanup
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Code cleanup
- Date: Mon, 22 Jun 2015 17:47:32 +0000 (UTC)
commit 3746f1bab51a28c1bc2207f2b6d12a61af7cd0bf
Author: Uwe Scholz <uwescholz src gnome org>
Date: Mon Jun 22 19:42:56 2015 +0200
Code cleanup
src/gnome-cmd-gkeyfile-utils.cc | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/gnome-cmd-gkeyfile-utils.cc b/src/gnome-cmd-gkeyfile-utils.cc
index 6a989e1..6fdcc1b 100644
--- a/src/gnome-cmd-gkeyfile-utils.cc
+++ b/src/gnome-cmd-gkeyfile-utils.cc
@@ -23,11 +23,9 @@
#include "config.h"
#include <glib.h>
-#include <glib/gi18n.h>
+#include <errno.h>
#include <glib/gstdio.h>
#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
#include "gnome-cmd-gkeyfile-utils.h"
@@ -90,7 +88,6 @@ gboolean gcmd_key_file_save_to_file (const gchar *filename,
{
gchar *contents;
FILE *fd;
- extern int errno;
gint length;
ssize_t written;
gboolean success = TRUE;
@@ -104,7 +101,7 @@ gboolean gcmd_key_file_save_to_file (const gchar *filename,
fd = fopen(filename, "w");
if (fd == NULL)
{
- g_critical("Cannot open file %s: %s\n", filename, strerror(errno));
+ g_critical("Cannot open file %s!\n", filename);
g_free(contents);
return FALSE;
}
@@ -113,7 +110,7 @@ gboolean gcmd_key_file_save_to_file (const gchar *filename,
if (written < 0)
{
success = FALSE;
- g_critical("Cannot write to file %s: %s\n", filename, strerror(errno));
+ g_critical("Cannot write to file %s!\n", filename);
fclose(fd);
}
else if (written != length)
@@ -126,7 +123,7 @@ gboolean gcmd_key_file_save_to_file (const gchar *filename,
}
else if (fclose(fd) == -1)
{
- g_warning("Close failed for file %s: %s", filename, strerror(errno));
+ g_warning("Close failed for file %s!", filename);
}
g_free(contents);
return success;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]