mirror of
https://github.com/upa/mscp.git
synced 2026-02-21 14:44:48 +08:00
tiny cleanup
This commit is contained in:
11
src/main.c
11
src/main.c
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user