Don't ingore return value of chown

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3590 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2008-04-23 03:00:37 +00:00
parent 805187cb87
commit 06a8e93105

View file

@ -2,6 +2,7 @@
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <dbus/dbus-glib.h>
#include <nm-setting.h>
#include <nm-setting-connection.h>
@ -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) {