aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-07-13 04:48:03 -0400
committerMike Frysinger <vapier@gentoo.org>2015-07-13 04:48:03 -0400
commitfa5ae8d08656c784c41818b298aa9321458b15ce (patch)
tree359ff64c3c11dd3e513d1831542062664595115b /paxinc.c
parentlddtree.py: convert to arparse (diff)
downloadpax-utils-fa5ae8d08656c784c41818b298aa9321458b15ce.tar.gz
pax-utils-fa5ae8d08656c784c41818b298aa9321458b15ce.tar.bz2
pax-utils-fa5ae8d08656c784c41818b298aa9321458b15ce.zip
scanelf: include filename/details in all ar related messages
When scanelf runs on a directory tree, it might issue an error message about invalid data because of one of the files in there. Trying to then track down that file is kind of a pain, so make things more explicit.
Diffstat (limited to 'paxinc.c')
-rw-r--r--paxinc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/paxinc.c b/paxinc.c
index b9a196b..f2ce3c5 100644
--- a/paxinc.c
+++ b/paxinc.c
@@ -40,7 +40,7 @@ archive_handle *ar_open(const char *filename)
archive_handle *ret;
if ((fd=open(filename, O_RDONLY)) == -1)
- err("Could not open '%s'", filename);
+ errp("%s: could not open", filename);
ret = ar_open_fd(filename, fd);
if (ret == NULL)
@@ -76,13 +76,13 @@ close_and_ret:
}
if ((ret.buf.formatted.magic[0] != '`') || (ret.buf.formatted.magic[1] != '\n')) {
- warn("Invalid ar entry");
+ warn("%s: invalid ar entry", ar->filename);
goto close_and_ret;
}
if (ret.buf.formatted.name[0] == '/' && ret.buf.formatted.name[1] == '/') {
if (ar->extfn != NULL) {
- warn("Duplicate GNU extended filename section");
+ warn("%s: Duplicate GNU extended filename section", ar->filename);
goto close_and_ret;
}
len = atoi(ret.buf.formatted.size);
@@ -112,7 +112,7 @@ close_and_ret:
} else if (s[0] == '/' && s[1] >= '0' && s[1] <= '9') {
/* GNU extended filename */
if (ar->extfn == NULL) {
- warn("GNU extended filename without special data section");
+ warn("%s: GNU extended filename without special data section", ar->filename);
goto close_and_ret;
}
s = ar->extfn + atoi(s + 1);