From owner-svn-src-all@freebsd.org Thu Apr 21 06:24:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEABEB16280; Thu, 21 Apr 2016 06:24:14 +0000 (UTC) (envelope-from araujo@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 mx1.freebsd.org (Postfix) with ESMTPS id BEFFA147C; Thu, 21 Apr 2016 06:24:14 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3L6OD7D056289; Thu, 21 Apr 2016 06:24:13 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3L6OD4s056287; Thu, 21 Apr 2016 06:24:13 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604210624.u3L6OD4s056287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298394 - head/sbin/restore X-SVN-Group: head 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.21 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: Thu, 21 Apr 2016 06:24:15 -0000 Author: araujo Date: Thu Apr 21 06:24:13 2016 New Revision: 298394 URL: https://svnweb.freebsd.org/changeset/base/298394 Log: Use MIN()/MAX() macros from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/restore/dirs.c head/sbin/restore/tape.c Modified: head/sbin/restore/dirs.c ============================================================================== --- head/sbin/restore/dirs.c Thu Apr 21 06:21:33 2016 (r298393) +++ head/sbin/restore/dirs.c Thu Apr 21 06:24:13 2016 (r298394) @@ -690,7 +690,7 @@ genliteraldir(char *name, ino_t ino) rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); dp = dup(dirp->dd_fd); for (i = itp->t_size; i > 0; i -= BUFSIZ) { - size = i < BUFSIZ ? i : BUFSIZ; + size = MIN(i, BUFSIZ); if (read(dp, buf, (int) size) == -1) { fprintf(stderr, "write error extracting inode %ju, name %s\n", Modified: head/sbin/restore/tape.c ============================================================================== --- head/sbin/restore/tape.c Thu Apr 21 06:21:33 2016 (r298393) +++ head/sbin/restore/tape.c Thu Apr 21 06:24:13 2016 (r298394) @@ -132,7 +132,7 @@ setinput(char *source, int ispipecommand if (bflag) newtapebuf(ntrec); else - newtapebuf(NTREC > HIGHDENSITYTREC ? NTREC : HIGHDENSITYTREC); + newtapebuf(MAX(NTREC, HIGHDENSITYTREC)); terminal = stdin; if (ispipecommand) @@ -1010,7 +1010,7 @@ loop: * block of the hole in the file. Postpone the * seek until next file write. */ - seekpos += (long)(size > TP_BSIZE ? TP_BSIZE : size); + seekpos += (long)MIN(TP_BSIZE, size); } if ((size -= TP_BSIZE) <= 0) { if (size > -TP_BSIZE && curblk > 0) {