aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2007-02-03 00:14:36 +0000
committerNed Ludd <solar@gentoo.org>2007-02-03 00:14:36 +0000
commiteb768191c806d90337b7f23e11177dcb9627d88c (patch)
tree8bbce64ea9714c6778a535e747ee059397ed3e7e /dumpelf.c
parent- update README to point at current anoncvs checkout (diff)
downloadpax-utils-eb768191c806d90337b7f23e11177dcb9627d88c.tar.gz
pax-utils-eb768191c806d90337b7f23e11177dcb9627d88c.tar.bz2
pax-utils-eb768191c806d90337b7f23e11177dcb9627d88c.zip
- do not output elf.h if we are doing dumpelf /dev/null
Diffstat (limited to 'dumpelf.c')
-rw-r--r--dumpelf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/dumpelf.c b/dumpelf.c
index 2e3cbe4..5359580 100644
--- a/dumpelf.c
+++ b/dumpelf.c
@@ -1,7 +1,7 @@
/*
* Copyright 2005-2006 Gentoo Foundation
* Distributed under the terms of the GNU General Public License v2
- * $Header: /var/cvsroot/gentoo-projects/pax-utils/dumpelf.c,v 1.20 2006/12/11 03:31:54 vapier Exp $
+ * $Header: /var/cvsroot/gentoo-projects/pax-utils/dumpelf.c,v 1.21 2007/02/03 00:14:36 solar Exp $
*
* Copyright 2005-2006 Ned Ludd - <solar@gentoo.org>
* Copyright 2005-2006 Mike Frysinger - <vapier@gentoo.org>
@@ -9,7 +9,7 @@
#include "paxinc.h"
-static const char *rcsid = "$Id: dumpelf.c,v 1.20 2006/12/11 03:31:54 vapier Exp $";
+static const char *rcsid = "$Id: dumpelf.c,v 1.21 2007/02/03 00:14:36 solar Exp $";
#define argv0 "dumpelf"
/* prototypes */
@@ -43,6 +43,8 @@ static void dumpelf(const char *filename, long file_cnt)
if ((elf = readelf(filename)) == NULL)
return;
+ printf("#include <elf.h>\n");
+
printf(
"\n"
"/*\n"
@@ -332,7 +334,7 @@ static void parseargs(int argc, char *argv[])
{
long file_cnt = 0;
- printf("#include <elf.h>\n");
+
while (optind < argc)
dumpelf(argv[optind++], file_cnt++);
}