mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-20 12:54:15 -04:00
Made a bunch of char* args const.
This commit is contained in:
1 parent
120cde9562
commit
63cf5ae72c
2 files changed
+9
-12
No files matched your search
@@ -45,14 +45,14 @@ extern int preserve_perms;
|
||||
|
||||
#define RETURN_ERROR_IF_RO_OR_LO RETURN_ERROR_IF(read_only || list_only, EROFS)
|
||||
|
||||
int do_unlink(char *fname)
|
||||
int do_unlink(const char *fname)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
RETURN_ERROR_IF_RO_OR_LO;
|
||||
return unlink(fname);
|
||||
}
|
||||
|
||||
int do_symlink(char *fname1, char *fname2)
|
||||
int do_symlink(const char *fname1, const char *fname2)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
RETURN_ERROR_IF_RO_OR_LO;
|
||||
@@ -60,7 +60,7 @@ int do_symlink(char *fname1, char *fname2)
|
||||
}
|
||||
|
||||
#ifdef HAVE_LINK
|
||||
int do_link(char *fname1, char *fname2)
|
||||
int do_link(const char *fname1, const char *fname2)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
RETURN_ERROR_IF_RO_OR_LO;
|
||||
@@ -118,14 +118,14 @@ int do_mknod(char *pathname, mode_t mode, dev_t dev)
|
||||
#endif
|
||||
}
|
||||
|
||||
int do_rmdir(char *pathname)
|
||||
int do_rmdir(const char *pathname)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
RETURN_ERROR_IF_RO_OR_LO;
|
||||
return rmdir(pathname);
|
||||
}
|
||||
|
||||
int do_open(char *pathname, int flags, mode_t mode)
|
||||
int do_open(const char *pathname, int flags, mode_t mode)
|
||||
{
|
||||
if (flags != O_RDONLY) {
|
||||
RETURN_ERROR_IF(dry_run, 0);
|
||||
@@ -155,14 +155,13 @@ int do_chmod(const char *path, mode_t mode)
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_rename(char *fname1, char *fname2)
|
||||
int do_rename(const char *fname1, const char *fname2)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
RETURN_ERROR_IF_RO_OR_LO;
|
||||
return rename(fname1, fname2);
|
||||
}
|
||||
|
||||
|
||||
void trim_trailing_slashes(char *name)
|
||||
{
|
||||
int l;
|
||||
@@ -181,7 +180,6 @@ void trim_trailing_slashes(char *name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int do_mkdir(char *fname, mode_t mode)
|
||||
{
|
||||
if (dry_run) return 0;
|
||||
@@ -190,7 +188,6 @@ int do_mkdir(char *fname, mode_t mode)
|
||||
return mkdir(fname, mode);
|
||||
}
|
||||
|
||||
|
||||
/* like mkstemp but forces permissions */
|
||||
int do_mkstemp(char *template, mode_t perms)
|
||||
{
|
||||
|
||||
@@ -260,7 +260,7 @@ static int safe_read(int desc, char *ptr, size_t len)
|
||||
*
|
||||
* This is used in conjunction with the --temp-dir, --backup, and
|
||||
* --copy-dest options. */
|
||||
int copy_file(char *source, char *dest, mode_t mode)
|
||||
int copy_file(const char *source, const char *dest, mode_t mode)
|
||||
{
|
||||
int ifd;
|
||||
int ofd;
|
||||
@@ -329,7 +329,7 @@ int copy_file(char *source, char *dest, mode_t mode)
|
||||
* --delete trying to remove old .rsyncNNN files, hence it renames it
|
||||
* each time.
|
||||
**/
|
||||
int robust_unlink(char *fname)
|
||||
int robust_unlink(const char *fname)
|
||||
{
|
||||
#ifndef ETXTBSY
|
||||
return do_unlink(fname);
|
||||
@@ -378,7 +378,7 @@ int robust_unlink(char *fname)
|
||||
|
||||
/* Returns 0 on successful rename, 1 if we successfully copied the file
|
||||
* across filesystems, -2 if copy_file() failed, and -1 on other errors. */
|
||||
int robust_rename(char *from, char *to, int mode)
|
||||
int robust_rename(const char *from, const char *to, int mode)
|
||||
{
|
||||
int tries = 4;
|
||||
|
||||
|
||||
Reference in new issue
Block a user