mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 04:40:09 +01:00
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:
parent
805187cb87
commit
06a8e93105
1 changed files with 6 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue