aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-10-02 21:52:29 +0000
committerMike Frysinger <vapier@gentoo.org>2011-10-02 21:52:29 +0000
commitf600bdbfd5ad7b3d67f82e448050c91621ca955c (patch)
treefcad082951e661144891b2cc5565265f812f5a18 /qtbz2.c
parentadd O_CLOEXEC fallback define #363271 (diff)
downloadportage-utils-f600bdbfd5ad7b3d67f82e448050c91621ca955c.tar.gz
portage-utils-f600bdbfd5ad7b3d67f82e448050c91621ca955c.tar.bz2
portage-utils-f600bdbfd5ad7b3d67f82e448050c91621ca955c.zip
make MIN/MAX helpers generally available
Diffstat (limited to 'qtbz2.c')
-rw-r--r--qtbz2.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/qtbz2.c b/qtbz2.c
index be62d06..f263488 100644
--- a/qtbz2.c
+++ b/qtbz2.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2010 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.18 2011/02/28 18:21:42 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/portage-utils/qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $
*
* Copyright 2005-2010 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2010 Mike Frysinger - <vapier@gentoo.org>
@@ -46,7 +46,7 @@ static const char * const qtbz2_opts_help[] = {
"Write files to stdout",
COMMON_OPTS_HELP
};
-static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.18 2011/02/28 18:21:42 vapier Exp $";
+static const char qtbz2_rcsid[] = "$Id: qtbz2.c,v 1.19 2011/10/02 21:52:29 vapier Exp $";
#define qtbz2_usage(ret) usage(ret, QTBZ2_FLAGS, qtbz2_long_opts, qtbz2_opts_help, lookup_applet_idx("qtbz2"))
static char tbz2_stdout = 0;
@@ -148,7 +148,6 @@ tbz2_compose(int dir_fd, const char *tarbz2, const char *xpak, const char *tbz2)
return ret;
}
-#define _TBZ2_MIN(a,b) (a < b ? : b)
static void
_tbz2_write_file(FILE *src, int dir_fd, const char *dst, size_t len)
{
@@ -174,7 +173,7 @@ _tbz2_write_file(FILE *src, int dir_fd, const char *dst, size_t len)
out = stdout;
do {
- this_write = fread(buffer, 1, _TBZ2_MIN(len, sizeof(buffer)), src);
+ this_write = fread(buffer, 1, MIN(len, sizeof(buffer)), src);
fwrite(buffer, 1, this_write, out);
len -= this_write;
} while (len && this_write);