mirror of
https://github.com/upa/mscp.git
synced 2026-02-17 11:44:48 +08:00
move direction from mscp_opts to mscp_init argument
This commit is contained in:
@@ -196,6 +196,7 @@ int main(int argc, char **argv)
|
||||
struct target *t;
|
||||
int pipe_fd[2];
|
||||
int ch, n, i, ret;
|
||||
int direction = 0;
|
||||
char *remote;
|
||||
bool dryrun = false;
|
||||
|
||||
@@ -312,11 +313,11 @@ int main(int argc, char **argv)
|
||||
|
||||
if (t[0].remote) {
|
||||
/* copy remote to local */
|
||||
o.direction = MSCP_DIRECTION_R2L;
|
||||
direction = MSCP_DIRECTION_R2L;
|
||||
remote = t[0].remote;
|
||||
} else {
|
||||
/* copy local to remote */
|
||||
o.direction = MSCP_DIRECTION_L2R;
|
||||
direction = MSCP_DIRECTION_L2R;
|
||||
remote = t[i - 1].remote;
|
||||
}
|
||||
|
||||
@@ -329,7 +330,7 @@ int main(int argc, char **argv)
|
||||
o.msg_fd = pipe_fd[1];
|
||||
}
|
||||
|
||||
if ((m = mscp_init(remote, &o, &s)) == NULL) {
|
||||
if ((m = mscp_init(remote, direction, &o, &s)) == NULL) {
|
||||
fprintf(stderr, "mscp_init: %s\n", mscp_get_error());
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user