From 06a8e931055af498fd27fd89fc40a3d6828b6333 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 23 Apr 2008 03:00:37 +0000 Subject: [PATCH] Don't ingore return value of chown git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3590 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- system-settings/plugins/keyfile/writer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/system-settings/plugins/keyfile/writer.c b/system-settings/plugins/keyfile/writer.c index b8bb5a1294..daef9c709d 100644 --- a/system-settings/plugins/keyfile/writer.c +++ b/system-settings/plugins/keyfile/writer.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -142,10 +143,13 @@ write_connection (NMConnection *connection) filename = g_build_filename (KEYFILE_DIR, s_con->id, NULL); g_file_set_contents (filename, data, len, &err); chmod (filename, S_IRUSR | S_IWUSR); - chown (filename, 0, 0); + if (chown (filename, 0, 0) < 0) { + g_warning ("Error chowning '%s': %d", filename, errno); + unlink (filename); + } else + success = TRUE; g_free (filename); - success = TRUE; } if (err) {