* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "rsync.h"
extern int safe_symlinks;
/* make a complete pathname for backup file */
-char *get_backup_name(char *fname)
+char *get_backup_name(const char *fname)
{
if (backup_dir) {
if (stringjoin(backup_dir_buf + backup_dir_len, backup_dir_remainder,
}
/* simple backup creates a backup with a suffix in the same directory */
-static int make_simple_backup(char *fname)
+static int make_simple_backup(const char *fname)
{
int rename_errno;
- char *fnamebak = get_backup_name(fname);
+ const char *fnamebak = get_backup_name(fname);
if (!fnamebak)
return 0;
full_fname(rel));
} else {
do_lchown(fullpath, st.st_uid, st.st_gid);
+#ifdef HAVE_CHMOD
do_chmod(fullpath, st.st_mode);
+#endif
}
}
*p = '/';
}
/* robustly move a file, creating new directory structures if necessary */
-static int robust_move(char *src, char *dst)
+static int robust_move(const char *src, char *dst)
{
if (robust_rename(src, dst, NULL, 0755) < 0
&& (errno != ENOENT || make_bak_dir(dst) < 0
/* If we have a --backup-dir, then we get here from make_backup().
* We will move the file to be deleted into a parallel directory tree. */
-static int keep_backup(char *fname)
+static int keep_backup(const char *fname)
{
STRUCT_STAT st;
struct file_struct *file;
/* main backup switch routine */
-int make_backup(char *fname)
+int make_backup(const char *fname)
{
if (backup_dir)
return keep_backup(fname);