From b8d58b1fba1d29d36b98dd19e544ff3002b286e4 Mon Sep 17 00:00:00 2001 From: Ryo Nakamura Date: Fri, 18 Nov 2022 13:47:24 +0900 Subject: tiny fix - set ssh nonblocking before closing sftp session - fix pprint for core mask --- src/main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 2fe8ee9..586dd61 100644 --- a/src/main.c +++ b/src/main.c @@ -370,10 +370,10 @@ int main(int argc, char **argv) if (coremask) { if (expand_coremask(coremask, &cores, &nr_cores) < 0) return -1; - pprint(1, "cpu cores:"); + pprint(2, "cpu cores:"); for (n = 0; n < nr_cores; n++) - pprint(1, " %d", cores[n]); - pprint(1, "\n"); + pprint(2, " %d", cores[n]); + pprint(2, "\n"); } /* create control session */ @@ -492,8 +492,12 @@ out: void mscp_copy_thread_cleanup(void *arg) { struct mscp_thread *t = arg; - if (t->sftp) + if (t->sftp) { + /* XXX: sftp_free --> ssh_poll sometimes blocked with + * no responses. So wet nonblocking. */ + ssh_set_blocking(sftp_ssh(t->sftp), 1); ssh_sftp_close(t->sftp); + } t->finished = true; __sync_synchronize(); } -- cgit v1.2.3