version 1.3, 2019/02/10 23:43:31 |
version 1.4, 2019/02/11 19:18:36 |
|
|
|
|
/* Make sure we have the same "hostspec" for all files. */ |
/* Make sure we have the same "hostspec" for all files. */ |
|
|
if ( ! f->remote) { |
if (!f->remote) { |
if (FARGS_SENDER == f->mode) |
if (FARGS_SENDER == f->mode) |
for (i = 0; i < f->sourcesz; i++) { |
for (i = 0; i < f->sourcesz; i++) { |
if ( ! fargs_is_remote(f->sources[i])) |
if (!fargs_is_remote(f->sources[i])) |
continue; |
continue; |
errx(EXIT_FAILURE, "remote file in " |
errx(EXIT_FAILURE, "remote file in " |
"list of local sources: %s", |
"list of local sources: %s", |
|
|
if (FARGS_RECEIVER == f->mode) |
if (FARGS_RECEIVER == f->mode) |
for (i = 0; i < f->sourcesz; i++) { |
for (i = 0; i < f->sourcesz; i++) { |
if (fargs_is_remote(f->sources[i]) && |
if (fargs_is_remote(f->sources[i]) && |
! fargs_is_daemon(f->sources[i])) |
!fargs_is_daemon(f->sources[i])) |
continue; |
continue; |
if (fargs_is_daemon(f->sources[i])) |
if (fargs_is_daemon(f->sources[i])) |
errx(EXIT_FAILURE, "remote " |
errx(EXIT_FAILURE, "remote " |
|
|
* Then exit if we're a sender or a local connection. |
* Then exit if we're a sender or a local connection. |
*/ |
*/ |
|
|
if ( ! f->remote) { |
if (!f->remote) { |
if (NULL == f->host) |
if (NULL == f->host) |
return f; |
return f; |
if (FARGS_SENDER == f->mode) { |
if (FARGS_SENDER == f->mode) { |
|
|
* So close the connection here so that they don't hang. |
* So close the connection here so that they don't hang. |
*/ |
*/ |
|
|
if ( ! c) { |
if (!c) { |
close(fds[0]); |
close(fds[0]); |
fds[0] = -1; |
fds[0] = -1; |
} |
} |
|
|
if (-1 == waitpid(child, &st, 0)) |
if (-1 == waitpid(child, &st, 0)) |
err(EXIT_FAILURE, "waitpid"); |
err(EXIT_FAILURE, "waitpid"); |
if ( ! (WIFEXITED(st) && EXIT_SUCCESS == WEXITSTATUS(st))) |
if (!(WIFEXITED(st) && EXIT_SUCCESS == WEXITSTATUS(st))) |
c = 0; |
c = 0; |
|
|
if (-1 != fds[0]) |
if (-1 != fds[0]) |