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
548abf96
Commit
548abf96
authored
Jan 13, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relocated some externs.
parent
f8ebdf92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
19 deletions
+8
-19
log.c
log.c
+8
-19
No files found.
log.c
View file @
548abf96
...
@@ -27,6 +27,14 @@
...
@@ -27,6 +27,14 @@
*/
*/
#include "rsync.h"
#include "rsync.h"
extern
int
am_daemon
;
extern
int
am_server
;
extern
int
am_sender
;
extern
int
quiet
;
extern
int
module_id
;
extern
char
*
auth_user
;
extern
char
*
log_format
;
static
int
log_initialised
;
static
int
log_initialised
;
static
char
*
logfname
;
static
char
*
logfname
;
static
FILE
*
logfile
;
static
FILE
*
logfile
;
...
@@ -216,9 +224,6 @@ void set_error_fd(int fd)
...
@@ -216,9 +224,6 @@ void set_error_fd(int fd)
void
rwrite
(
enum
logcode
code
,
char
*
buf
,
int
len
)
void
rwrite
(
enum
logcode
code
,
char
*
buf
,
int
len
)
{
{
FILE
*
f
=
NULL
;
FILE
*
f
=
NULL
;
extern
int
am_daemon
;
extern
int
am_server
;
extern
int
quiet
;
/* recursion can happen with certain fatal conditions */
/* recursion can happen with certain fatal conditions */
if
(
quiet
&&
code
==
FINFO
)
return
;
if
(
quiet
&&
code
==
FINFO
)
return
;
...
@@ -379,7 +384,6 @@ void rsyserr(enum logcode code, int errcode, const char *format, ...)
...
@@ -379,7 +384,6 @@ void rsyserr(enum logcode code, int errcode, const char *format, ...)
void
rflush
(
enum
logcode
code
)
void
rflush
(
enum
logcode
code
)
{
{
FILE
*
f
=
NULL
;
FILE
*
f
=
NULL
;
extern
int
am_daemon
;
if
(
am_daemon
)
{
if
(
am_daemon
)
{
return
;
return
;
...
@@ -394,7 +398,6 @@ void rflush(enum logcode code)
...
@@ -394,7 +398,6 @@ void rflush(enum logcode code)
}
}
if
(
code
==
FINFO
)
{
if
(
code
==
FINFO
)
{
extern
int
am_server
;
if
(
am_server
)
if
(
am_server
)
f
=
stderr
;
f
=
stderr
;
else
else
...
@@ -413,15 +416,10 @@ static void log_formatted(enum logcode code,
...
@@ -413,15 +416,10 @@ static void log_formatted(enum logcode code,
char
*
format
,
char
*
op
,
struct
file_struct
*
file
,
char
*
format
,
char
*
op
,
struct
file_struct
*
file
,
struct
stats
*
initial_stats
)
struct
stats
*
initial_stats
)
{
{
extern
int
module_id
;
extern
char
*
auth_user
;
char
buf
[
1024
];
char
buf
[
1024
];
char
buf2
[
1024
];
char
buf2
[
1024
];
char
*
p
,
*
s
,
*
n
;
char
*
p
,
*
s
,
*
n
;
size_t
l
;
size_t
l
;
extern
struct
stats
stats
;
extern
int
am_sender
;
extern
int
am_daemon
;
int64
b
;
int64
b
;
/* We expand % codes one by one in place in buf. We don't
/* We expand % codes one by one in place in buf. We don't
...
@@ -519,10 +517,6 @@ static void log_formatted(enum logcode code,
...
@@ -519,10 +517,6 @@ static void log_formatted(enum logcode code,
/* log the outgoing transfer of a file */
/* log the outgoing transfer of a file */
void
log_send
(
struct
file_struct
*
file
,
struct
stats
*
initial_stats
)
void
log_send
(
struct
file_struct
*
file
,
struct
stats
*
initial_stats
)
{
{
extern
int
module_id
;
extern
int
am_server
;
extern
char
*
log_format
;
if
(
lp_transfer_logging
(
module_id
))
{
if
(
lp_transfer_logging
(
module_id
))
{
log_formatted
(
FLOG
,
lp_log_format
(
module_id
),
"send"
,
file
,
initial_stats
);
log_formatted
(
FLOG
,
lp_log_format
(
module_id
),
"send"
,
file
,
initial_stats
);
}
else
if
(
log_format
&&
!
am_server
)
{
}
else
if
(
log_format
&&
!
am_server
)
{
...
@@ -533,10 +527,6 @@ void log_send(struct file_struct *file, struct stats *initial_stats)
...
@@ -533,10 +527,6 @@ void log_send(struct file_struct *file, struct stats *initial_stats)
/* log the incoming transfer of a file */
/* log the incoming transfer of a file */
void
log_recv
(
struct
file_struct
*
file
,
struct
stats
*
initial_stats
)
void
log_recv
(
struct
file_struct
*
file
,
struct
stats
*
initial_stats
)
{
{
extern
int
module_id
;
extern
int
am_server
;
extern
char
*
log_format
;
if
(
lp_transfer_logging
(
module_id
))
{
if
(
lp_transfer_logging
(
module_id
))
{
log_formatted
(
FLOG
,
lp_log_format
(
module_id
),
"recv"
,
file
,
initial_stats
);
log_formatted
(
FLOG
,
lp_log_format
(
module_id
),
"recv"
,
file
,
initial_stats
);
}
else
if
(
log_format
&&
!
am_server
)
{
}
else
if
(
log_format
&&
!
am_server
)
{
...
@@ -556,7 +546,6 @@ void log_recv(struct file_struct *file, struct stats *initial_stats)
...
@@ -556,7 +546,6 @@ void log_recv(struct file_struct *file, struct stats *initial_stats)
void
log_exit
(
int
code
,
const
char
*
file
,
int
line
)
void
log_exit
(
int
code
,
const
char
*
file
,
int
line
)
{
{
if
(
code
==
0
)
{
if
(
code
==
0
)
{
extern
struct
stats
stats
;
rprintf
(
FLOG
,
"wrote %.0f bytes read %.0f bytes total size %.0f
\n
"
,
rprintf
(
FLOG
,
"wrote %.0f bytes read %.0f bytes total size %.0f
\n
"
,
(
double
)
stats
.
total_written
,
(
double
)
stats
.
total_written
,
(
double
)
stats
.
total_read
,
(
double
)
stats
.
total_read
,
...
...
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