Index: gedit/gedit-document-saver.c =================================================================== RCS file: /cvs/gnome/gedit/gedit/gedit-document-saver.c,v retrieving revision 1.5 diff -u -p -r1.5 gedit-document-saver.c --- gedit/gedit-document-saver.c 1 Feb 2006 08:32:36 -0000 1.5 +++ gedit/gedit-document-saver.c 30 Mar 2006 18:42:27 -0000 @@ -663,6 +663,8 @@ save_existing_local_file (GeditDocumentS /* move away old backups */ if (!remove_file (backup_filename)) { + g_print ("Failed unlink!\n"); + /* we don't care about which was the problem, just * that a backup was not possible. */ @@ -680,6 +682,8 @@ save_existing_local_file (GeditDocumentS if (bfd == -1) { + g_print ("Failed open!\n"); + g_set_error (&saver->priv->error, GEDIT_DOCUMENT_ERROR, GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP, @@ -692,12 +696,15 @@ save_existing_local_file (GeditDocumentS * original file. If this fails, set the protection * bits for the group same as the protection bits for * others. */ - if (fchown (bfd, (uid_t) -1, statbuf.st_gid) != 0) + if ((getgid () != statbuf.st_gid) && + (fchown (bfd, (uid_t) -1, statbuf.st_gid) != 0)) { if (fchmod (bfd, (statbuf.st_mode& 0707) | ((statbuf.st_mode & 07) << 3)) != 0) { + g_print ("Failed chmod!\n"); + g_set_error (&saver->priv->error, GEDIT_DOCUMENT_ERROR, GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP, @@ -712,6 +719,8 @@ save_existing_local_file (GeditDocumentS if (!copy_file_data (saver->priv->fd, bfd, NULL)) { + g_print ("Failed copy!\n"); + g_set_error (&saver->priv->error, GEDIT_DOCUMENT_ERROR, GEDIT_DOCUMENT_ERROR_CANT_CREATE_BACKUP,