Convert to errx()
This commit is contained in:
parent
9a784c6a99
commit
7718805b57
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=61027
@ -123,10 +123,8 @@ main(argc, argv)
|
|||||||
|
|
||||||
/* create connection with server */
|
/* create connection with server */
|
||||||
cl = clnt_create(*argv, SPRAYPROG, SPRAYVERS, "udp");
|
cl = clnt_create(*argv, SPRAYPROG, SPRAYVERS, "udp");
|
||||||
if (cl == NULL) {
|
if (cl == NULL)
|
||||||
clnt_pcreateerror("spray");
|
errx(1, "%s", clnt_spcreateerror(NULL));
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -140,10 +138,8 @@ main(argc, argv)
|
|||||||
|
|
||||||
|
|
||||||
/* Clear server statistics */
|
/* Clear server statistics */
|
||||||
if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) {
|
if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS)
|
||||||
clnt_perror(cl, "spray");
|
errx(1, "%s", clnt_sperror(cl, NULL));
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Spray server with packets */
|
/* Spray server with packets */
|
||||||
@ -160,10 +156,8 @@ main(argc, argv)
|
|||||||
|
|
||||||
|
|
||||||
/* Collect statistics from server */
|
/* Collect statistics from server */
|
||||||
if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS) {
|
if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS)
|
||||||
clnt_perror(cl, "spray");
|
errx(1, "%s", clnt_sperror(cl, NULL));
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
xmit_time = host_stats.clock.sec +
|
xmit_time = host_stats.clock.sec +
|
||||||
(host_stats.clock.usec / 1000000.0);
|
(host_stats.clock.usec / 1000000.0);
|
||||||
|
Loading…
Reference in New Issue
Block a user