summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2016-04-21 06:24:13 +0000
committeraraujo <araujo@FreeBSD.org>2016-04-21 06:24:13 +0000
commit5fd8491a5e356cdb82c15af59da834b9cf9f3732 (patch)
treeeacadc49a0b252e182ea312473eb58438f3d1149
parent0726a6056d459e0ad42fcc14454549e731a58c78 (diff)
downloadFreeBSD-src-5fd8491a5e356cdb82c15af59da834b9cf9f3732.zip
FreeBSD-src-5fd8491a5e356cdb82c15af59da834b9cf9f3732.tar.gz
Use MIN()/MAX() macros from sys/param.h.
MFC after: 2 weeks.
-rw-r--r--sbin/restore/dirs.c2
-rw-r--r--sbin/restore/tape.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/sbin/restore/dirs.c b/sbin/restore/dirs.c
index dcdc424..dcf2840 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 2f97231..3c0a510 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 @@ 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) {
OpenPOWER on IntegriCloud