From f1d02935174b9d1fc5f89702da018450d5b9325c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 9 Feb 2011 17:11:13 -0600 Subject: [PATCH] keyfile: trivial code simplification --- system-settings/plugins/keyfile/writer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index 2fc880e185..2fcd306e0c 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -700,7 +700,6 @@ nm_keyfile_plugin_write_connection (NMConnection *connection, gsize len; gboolean success = FALSE; char *filename, *path; - int err; const char *id; if (out_path) @@ -730,8 +729,7 @@ nm_keyfile_plugin_write_connection (NMConnection *connection, path, errno); unlink (path); } else { - err = chmod (path, S_IRUSR | S_IWUSR); - if (err) { + if (chmod (path, S_IRUSR | S_IWUSR) < 0) { g_set_error (error, KEYFILE_PLUGIN_ERROR, 0, "%s.%d: error setting permissions on '%s': %d", __FILE__, __LINE__, path, errno);