From owner-svn-src-all@freebsd.org Mon Jun 25 11:44:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E76F61009BC0; Mon, 25 Jun 2018 11:44:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96A5A79086; Mon, 25 Jun 2018 11:44:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77D0B2CB81; Mon, 25 Jun 2018 11:44:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5PBiu7E033442; Mon, 25 Jun 2018 11:44:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5PBiu3k033441; Mon, 25 Jun 2018 11:44:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806251144.w5PBiu3k033441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 25 Jun 2018 11:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335638 - head/usr.bin/rusers X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/rusers X-SVN-Commit-Revision: 335638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 11:44:57 -0000 Author: eadler Date: Mon Jun 25 11:44:56 2018 New Revision: 335638 URL: https://svnweb.freebsd.org/changeset/base/335638 Log: rusers: modernize a bit Modified: head/usr.bin/rusers/rusers.c Modified: head/usr.bin/rusers/rusers.c ============================================================================== --- head/usr.bin/rusers/rusers.c Mon Jun 25 11:44:53 2018 (r335637) +++ head/usr.bin/rusers/rusers.c Mon Jun 25 11:44:56 2018 (r335638) @@ -94,9 +94,9 @@ remember_host(struct in_addr addr) } static int -rusers_reply(caddr_t replyp, struct sockaddr_in *raddrp) +rusers_reply(void *replyp, struct sockaddr_in *raddrp) { - u_int x; + unsigned int x; int idle; char date[32], idle_time[64], remote[64]; struct hostent *hp; @@ -190,14 +190,14 @@ onehost(char *host) if (rusers_clnt == NULL) errx(1, "%s", clnt_spcreateerror("")); - bzero((char *)&up, sizeof(up)); + memset(&up, 0, sizeof(up)); tv.tv_sec = 15; /* XXX ?? */ tv.tv_usec = 0; if (clnt_call(rusers_clnt, RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_utmpidlearr, &up, tv) != RPC_SUCCESS) errx(1, "%s", clnt_sperror(rusers_clnt, "")); memcpy(&addr.sin_addr.s_addr, hp->h_addr, sizeof(addr.sin_addr.s_addr)); - rusers_reply((caddr_t)&up, &addr); + rusers_reply(&up, &addr); clnt_destroy(rusers_clnt); } @@ -207,7 +207,7 @@ allhosts(void) utmpidlearr up; enum clnt_stat clnt_stat; - bzero((char *)&up, sizeof(up)); + memset(&up, 0, sizeof(up)); clnt_stat = clnt_broadcast(RUSERSPROG, RUSERSVERS_IDLE, RUSERSPROC_NAMES, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_utmpidlearr, (char *)&up,