Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
accc091f
Commit
accc091f
authored
Sep 07, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always use lutimes() if it is available.
parent
4b660bae
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
15 deletions
+18
-15
compat.c
compat.c
+3
-3
generator.c
generator.c
+2
-2
options.c
options.c
+2
-2
rsync.h
rsync.h
+4
-0
util.c
util.c
+7
-8
No files found.
compat.c
View file @
accc091f
...
@@ -248,7 +248,7 @@ void setup_protocol(int f_out,int f_in)
...
@@ -248,7 +248,7 @@ void setup_protocol(int f_out,int f_in)
int
compat_flags
;
int
compat_flags
;
if
(
am_server
)
{
if
(
am_server
)
{
compat_flags
=
allow_inc_recurse
?
CF_INC_RECURSE
:
0
;
compat_flags
=
allow_inc_recurse
?
CF_INC_RECURSE
:
0
;
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
compat_flags
|=
CF_SYMLINK_TIMES
;
compat_flags
|=
CF_SYMLINK_TIMES
;
#endif
#endif
#ifdef ICONV_OPTION
#ifdef ICONV_OPTION
...
@@ -264,7 +264,7 @@ void setup_protocol(int f_out,int f_in)
...
@@ -264,7 +264,7 @@ void setup_protocol(int f_out,int f_in)
?
strchr
(
client_info
,
'L'
)
!=
NULL
?
strchr
(
client_info
,
'L'
)
!=
NULL
:
!!
(
compat_flags
&
CF_SYMLINK_TIMES
);
:
!!
(
compat_flags
&
CF_SYMLINK_TIMES
);
}
}
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
else
else
receiver_symlink_times
=
1
;
receiver_symlink_times
=
1
;
#endif
#endif
...
@@ -281,7 +281,7 @@ void setup_protocol(int f_out,int f_in)
...
@@ -281,7 +281,7 @@ void setup_protocol(int f_out,int f_in)
exit_cleanup
(
RERR_SYNTAX
);
exit_cleanup
(
RERR_SYNTAX
);
}
}
need_messages_from_generator
=
1
;
need_messages_from_generator
=
1
;
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
}
else
if
(
!
am_sender
)
{
}
else
if
(
!
am_sender
)
{
receiver_symlink_times
=
1
;
receiver_symlink_times
=
1
;
#endif
#endif
...
...
generator.c
View file @
accc091f
...
@@ -392,7 +392,7 @@ static void do_delete_pass(void)
...
@@ -392,7 +392,7 @@ static void do_delete_pass(void)
int
unchanged_attrs
(
const
char
*
fname
,
struct
file_struct
*
file
,
stat_x
*
sxp
)
int
unchanged_attrs
(
const
char
*
fname
,
struct
file_struct
*
file
,
stat_x
*
sxp
)
{
{
#if
!defined HAVE_LUTIMES || !defined HAVE_U
TIMES
#if
ndef CAN_SET_SYMLINK_
TIMES
if
(
S_ISLNK
(
file
->
mode
))
{
if
(
S_ISLNK
(
file
->
mode
))
{
;
;
}
else
}
else
...
@@ -440,7 +440,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
...
@@ -440,7 +440,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
if
(
statret
>=
0
)
{
/* A from-dest-dir statret can == 1! */
if
(
statret
>=
0
)
{
/* A from-dest-dir statret can == 1! */
int
keep_time
=
!
preserve_times
?
0
int
keep_time
=
!
preserve_times
?
0
:
S_ISDIR
(
file
->
mode
)
?
preserve_times
>
1
:
:
S_ISDIR
(
file
->
mode
)
?
preserve_times
>
1
:
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
1
;
1
;
#else
#else
!
S_ISLNK
(
file
->
mode
);
!
S_ISLNK
(
file
->
mode
);
...
...
options.c
View file @
accc091f
...
@@ -596,7 +596,7 @@ static void print_rsync_version(enum logcode f)
...
@@ -596,7 +596,7 @@ static void print_rsync_version(enum logcode f)
#ifdef ICONV_OPTION
#ifdef ICONV_OPTION
iconv
=
""
;
iconv
=
""
;
#endif
#endif
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
symtimes
=
""
;
symtimes
=
""
;
#endif
#endif
...
@@ -2358,7 +2358,7 @@ void server_options(char **args, int *argc_p)
...
@@ -2358,7 +2358,7 @@ void server_options(char **args, int *argc_p)
argstr
[
x
++
]
=
'.'
;
argstr
[
x
++
]
=
'.'
;
if
(
allow_inc_recurse
)
if
(
allow_inc_recurse
)
argstr
[
x
++
]
=
'i'
;
argstr
[
x
++
]
=
'i'
;
#if
defined HAVE_LUTIMES && defined HAVE_U
TIMES
#if
def CAN_SET_SYMLINK_
TIMES
argstr
[
x
++
]
=
'L'
;
argstr
[
x
++
]
=
'L'
;
#endif
#endif
#ifdef ICONV_OPTION
#ifdef ICONV_OPTION
...
...
rsync.h
View file @
accc091f
...
@@ -359,6 +359,10 @@ enum delret {
...
@@ -359,6 +359,10 @@ enum delret {
#include <utime.h>
#include <utime.h>
#endif
#endif
#ifdef HAVE_LUTIMES
#define CAN_SET_SYMLINK_TIMES 1
#endif
#ifdef HAVE_SYS_SELECT_H
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#include <sys/select.h>
#endif
#endif
...
...
util.c
View file @
accc091f
...
@@ -125,7 +125,7 @@ NORETURN void overflow_exit(const char *str)
...
@@ -125,7 +125,7 @@ NORETURN void overflow_exit(const char *str)
int
set_modtime
(
const
char
*
fname
,
time_t
modtime
,
mode_t
mode
)
int
set_modtime
(
const
char
*
fname
,
time_t
modtime
,
mode_t
mode
)
{
{
#if
!defined HAVE_LUTIMES || !defined HAVE_U
TIMES
#if
ndef CAN_SET_SYMLINK_
TIMES
if
(
S_ISLNK
(
mode
))
if
(
S_ISLNK
(
mode
))
return
1
;
return
1
;
#endif
#endif
...
@@ -140,20 +140,19 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
...
@@ -140,20 +140,19 @@ int set_modtime(const char *fname, time_t modtime, mode_t mode)
return
0
;
return
0
;
{
{
#if
def HAVE_
UTIMES
#if
defined HAVE_UTIMES || defined HAVE_L
UTIMES
struct
timeval
t
[
2
];
struct
timeval
t
[
2
];
t
[
0
].
tv_sec
=
time
(
NULL
);
t
[
0
].
tv_sec
=
time
(
NULL
);
t
[
0
].
tv_usec
=
0
;
t
[
0
].
tv_usec
=
0
;
t
[
1
].
tv_sec
=
modtime
;
t
[
1
].
tv_sec
=
modtime
;
t
[
1
].
tv_usec
=
0
;
t
[
1
].
tv_usec
=
0
;
# ifdef HAVE_LUTIMES
# ifdef HAVE_LUTIMES
if
(
S_ISLNK
(
mode
))
{
if
(
lutimes
(
fname
,
t
)
<
0
)
if
(
lutimes
(
fname
,
t
)
<
0
)
return
S_ISLNK
(
mode
)
&&
errno
==
ENOSYS
?
1
:
-
1
;
return
errno
==
ENOSYS
?
1
:
-
1
;
return
0
;
return
0
;
# else
}
# endif
return
utimes
(
fname
,
t
);
return
utimes
(
fname
,
t
);
# endif
#elif defined HAVE_STRUCT_UTIMBUF
#elif defined HAVE_STRUCT_UTIMBUF
struct
utimbuf
tbuf
;
struct
utimbuf
tbuf
;
tbuf
.
actime
=
time
(
NULL
);
tbuf
.
actime
=
time
(
NULL
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment