From f4b72a8dd2ff43e54fdce08846e5046aa8f417f5 Mon Sep 17 00:00:00 2001 From: Marcelo Araujo Date: Thu, 21 Apr 2016 06:24:13 +0000 Subject: [PATCH] Use MIN()/MAX() macros from sys/param.h. MFC after: 2 weeks. --- sbin/restore/dirs.c | 2 +- sbin/restore/tape.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c index dcdc4243f361..dcf28400c528 100644 --- a/sbin/restore/dirs.c +++ b/sbin/restore/dirs.c @@ -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", diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c index 2f972318ddc3..3c0a510140cc 100644 --- a/sbin/restore/tape.c +++ b/sbin/restore/tape.c @@ -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 @@ getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), * 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) {