Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
610364e
)
Rearrange code slightly to avoid util.c depending on main.c.
author
Martin Pool
<mbp@samba.org>
Mon, 8 Apr 2002 03:37:19 +0000
(
03:37
+0000)
committer
Martin Pool
<mbp@samba.org>
Mon, 8 Apr 2002 03:37:19 +0000
(
03:37
+0000)
main.c
patch
|
blob
|
blame
|
history
util.c
patch
|
blob
|
blame
|
history
diff --git
a/main.c
b/main.c
index
ef274c7
..
86eca2c
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-231,7
+231,7
@@
static pid_t do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int
if (local_server) {
if (read_batch)
create_flist_from_batch(); /* sets batch_flist */
if (local_server) {
if (read_batch)
create_flist_from_batch(); /* sets batch_flist */
- ret = local_child(argc, args, f_in, f_out);
+ ret = local_child(argc, args, f_in, f_out
, child_main
);
} else {
ret = piped_child(args,f_in,f_out);
}
} else {
ret = piped_child(args,f_in,f_out);
}
@@
-493,6
+493,12
@@
static void do_server_recv(int f_in, int f_out, int argc,char *argv[])
}
}
+void child_main(int argc, char *argv[])
+{
+ start_server(STDIN_FILENO, STDOUT_FILENO, argc, argv);
+}
+
+
void start_server(int f_in, int f_out, int argc, char *argv[])
{
extern int cvs_exclude;
void start_server(int f_in, int f_out, int argc, char *argv[])
{
extern int cvs_exclude;
diff --git
a/util.c
b/util.c
index
db62587
..
9b54c05
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-179,7
+179,8
@@
pid_t piped_child(char **command, int *f_in, int *f_out)
return pid;
}
return pid;
}
-pid_t local_child(int argc, char **argv,int *f_in,int *f_out)
+pid_t local_child(int argc, char **argv,int *f_in,int *f_out,
+ int (*child_main)(int, char **))
{
pid_t pid;
int to_child_pipe[2];
{
pid_t pid;
int to_child_pipe[2];
@@
-215,7
+216,7
@@
pid_t local_child(int argc, char **argv,int *f_in,int *f_out)
}
if (to_child_pipe[0] != STDIN_FILENO) close(to_child_pipe[0]);
if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]);
}
if (to_child_pipe[0] != STDIN_FILENO) close(to_child_pipe[0]);
if (from_child_pipe[1] != STDOUT_FILENO) close(from_child_pipe[1]);
-
start_server(STDIN_FILENO, STDOUT_FILENO,
argc, argv);
+
child_main(
argc, argv);
}
if (close(from_child_pipe[1]) < 0 ||
}
if (close(from_child_pipe[1]) < 0 ||
@@
-991,9
+992,9
@@
void show_progress(OFF_T ofs, OFF_T size)
*
* @param dest Target of the symlink in question.
*
*
* @param dest Target of the symlink in question.
*
- * @
src
src Top source directory currently applicable. Basically this
+ * @
param
src Top source directory currently applicable. Basically this
* is the first parameter to rsync in a simple invocation, but it's
* is the first parameter to rsync in a simple invocation, but it's
- * modified
as topsrcname
in slightly complex ways.
+ * modified
by flist.c
in slightly complex ways.
*
* @retval True if unsafe
* @retval False is unsafe
*
* @retval True if unsafe
* @retval False is unsafe