From owner-svn-src-head@FreeBSD.ORG Fri Sep 25 22:20:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE4511065670; Fri, 25 Sep 2009 22:20:30 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD08E8FC19; Fri, 25 Sep 2009 22:20:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8PMKUJU041293; Fri, 25 Sep 2009 22:20:30 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8PMKUnE041291; Fri, 25 Sep 2009 22:20:30 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200909252220.n8PMKUnE041291@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 25 Sep 2009 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197506 - head/libexec/rpc.rquotad X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2009 22:20:31 -0000 Author: des Date: Fri Sep 25 22:20:30 2009 New Revision: 197506 URL: http://svn.freebsd.org/changeset/base/197506 Log: Slight style cleanup. Modified: head/libexec/rpc.rquotad/rquotad.c Modified: head/libexec/rpc.rquotad/rquotad.c ============================================================================== --- head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 20:08:53 2009 (r197505) +++ head/libexec/rpc.rquotad/rquotad.c Fri Sep 25 22:20:30 2009 (r197506) @@ -56,8 +56,8 @@ static void cleanup(int sig) { - (void) sig; - (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); + (void)sig; + (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); exit(0); } @@ -70,18 +70,17 @@ main(void) socklen_t fromlen; fromlen = sizeof(from); - if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) { + if (getsockname(0, (struct sockaddr *)&from, &fromlen) < 0) from_inetd = 0; - } if (!from_inetd) { daemon(0, 0); - (void) rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); + (void)rpcb_unset(RQUOTAPROG, RQUOTAVERS, NULL); - (void) signal(SIGINT, cleanup); - (void) signal(SIGTERM, cleanup); - (void) signal(SIGHUP, cleanup); + (void)signal(SIGINT, cleanup); + (void)signal(SIGTERM, cleanup); + (void)signal(SIGHUP, cleanup); } openlog("rpc.rquotad", LOG_CONS|LOG_PID, LOG_DAEMON); @@ -94,10 +93,11 @@ main(void) exit(1); } ok = svc_reg(transp, RQUOTAPROG, RQUOTAVERS, - rquota_service, NULL); - } else + rquota_service, NULL); + } else { ok = svc_create(rquota_service, - RQUOTAPROG, RQUOTAVERS, "udp"); + RQUOTAPROG, RQUOTAVERS, "udp"); + } if (!ok) { syslog(LOG_ERR, "unable to register (RQUOTAPROG, RQUOTAVERS, %s)", @@ -142,7 +142,7 @@ sendquota(struct svc_req *request, SVCXP struct dqblk dqblk; struct timeval timev; - bzero((char *)&getq_args, sizeof(getq_args)); + bzero(&getq_args, sizeof(getq_args)); if (!svc_getargs(transp, (xdrproc_t)xdr_getquota_args, &getq_args)) { svcerr_decode(transp); return; @@ -195,7 +195,7 @@ printerr_reply(SVCXPRT *transp) /* when caller = (struct sockaddr *)svc_getrpccaller(transp)->buf; getnameinfo(caller, caller->sa_len, name, sizeof (name), - NULL, 0, NI_NUMERICHOST); + NULL, 0, NI_NUMERICHOST); errno = save_errno; if (errno == 0) syslog(LOG_ERR, "couldn't send reply to %s", name); @@ -220,15 +220,13 @@ initfs(void) if (!hasquota(fs, &qfpathname)) continue; - fs_current = (struct fs_stat *) malloc(sizeof(struct fs_stat)); + fs_current = malloc(sizeof(struct fs_stat)); fs_current->fs_next = fs_next; /* next element */ - fs_current->fs_file = - malloc(sizeof(char) * (strlen(fs->fs_file) + 1)); + fs_current->fs_file = malloc(strlen(fs->fs_file) + 1); strcpy(fs_current->fs_file, fs->fs_file); - fs_current->qfpathname = - malloc(sizeof(char) * (strlen(qfpathname) + 1)); + fs_current->qfpathname = malloc(strlen(qfpathname) + 1); strcpy(fs_current->qfpathname, qfpathname); stat(fs_current->fs_file, &st);