diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-03-11 21:48:07 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-03-11 21:48:07 +0900 |
commit | 74d58e986a9d4d04e48cc344f13659e062fd3799 (patch) | |
tree | 52e2890416e3560fca3531042e7497aea05c2643 /src/main.c | |
parent | 7e7bc61ff2643f42bfb9152de6a94aa1fcf3c664 (diff) |
move direction from mscp_opts to mscp_init argument
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } |