tiny cleanup

This commit is contained in:
Ryo Nakamura
2023-03-03 18:30:34 +09:00
parent a0b7482f66
commit c5aa70d9c9
2 changed files with 4 additions and 9 deletions

View File

@@ -179,7 +179,7 @@ int main(int argc, char **argv)
struct mscp_ssh_opts s; struct mscp_ssh_opts s;
struct mscp_opts o; struct mscp_opts o;
struct target *t; struct target *t;
int ch, n, i; int ch, n, i, ret;
char *remote; char *remote;
memset(&s, 0, sizeof(s)); memset(&s, 0, sizeof(s));
@@ -304,9 +304,8 @@ int main(int argc, char **argv)
if ((m = mscp_init(remote, &o, &s)) == NULL) if ((m = mscp_init(remote, &o, &s)) == NULL)
return -1; return -1;
if (mscp_connect(m) < 0) { if (mscp_connect(m) < 0)
return -1; return -1;
}
for (n = 0; n < i - 1; n++) { for (n = 0; n < i - 1; n++) {
if (mscp_add_src_path(m, t[n].path) < 0) if (mscp_add_src_path(m, t[n].path) < 0)
@@ -327,16 +326,14 @@ int main(int argc, char **argv)
return -1; return -1;
} }
if (mscp_start(m) < 0) ret = mscp_start(m);
return -1;
print_stat_final(); print_stat_final();
err_out:
mscp_cleanup(m); mscp_cleanup(m);
mscp_free(m); mscp_free(m);
return 0; return ret;
} }

View File

@@ -1,7 +1,5 @@
#include <stdbool.h> #include <stdbool.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <math.h> #include <math.h>
#include <pthread.h> #include <pthread.h>