From 7718805b57275bcdaeba2821f90d033e86fad4ab Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Sun, 28 May 2000 15:05:15 +0000 Subject: [PATCH] Convert to errx() --- usr.sbin/spray/spray.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/usr.sbin/spray/spray.c b/usr.sbin/spray/spray.c index a0e446cc2789..fd08e2d812a5 100644 --- a/usr.sbin/spray/spray.c +++ b/usr.sbin/spray/spray.c @@ -123,10 +123,8 @@ main(argc, argv) /* create connection with server */ cl = clnt_create(*argv, SPRAYPROG, SPRAYVERS, "udp"); - if (cl == NULL) { - clnt_pcreateerror("spray"); - exit(1); - } + if (cl == NULL) + errx(1, "%s", clnt_spcreateerror(NULL)); /* @@ -140,10 +138,8 @@ main(argc, argv) /* Clear server statistics */ - if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) { - clnt_perror(cl, "spray"); - exit(1); - } + if (clnt_call(cl, SPRAYPROC_CLEAR, xdr_void, NULL, xdr_void, NULL, TIMEOUT) != RPC_SUCCESS) + errx(1, "%s", clnt_sperror(cl, NULL)); /* Spray server with packets */ @@ -160,10 +156,8 @@ main(argc, argv) /* Collect statistics from server */ - if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS) { - clnt_perror(cl, "spray"); - exit(1); - } + if (clnt_call(cl, SPRAYPROC_GET, xdr_void, NULL, xdr_spraycumul, &host_stats, TIMEOUT) != RPC_SUCCESS) + errx(1, "%s", clnt_sperror(cl, NULL)); xmit_time = host_stats.clock.sec + (host_stats.clock.usec / 1000000.0);