summaryrefslogtreecommitdiff
path: root/devel/elfutils/files/patch-lib_error.c
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2016-07-13 17:48:54 +0000
committerConrad Meyer <cem@FreeBSD.org>2016-07-13 17:48:54 +0000
commit552479055ed8ad7f7ffca61077c088b9c70dca75 (patch)
treeab51fff0d12ebcaa9f5ecac4eccad04a060ba2a6 /devel/elfutils/files/patch-lib_error.c
parentActually remove needless patch. (diff)
Add elfutils 0.163
Elfutils is a collection of utilities, including: stack (to show backtraces); nm (for listing symbols from object files); size (for listing the section sizes of an object or archive file); strip (for discarding symbols); readelf (to see the raw ELF file structures); elflint (to check for well-formed ELF files); and elfcompress (to compress or decompress ELF sections). It also provides libraries to allow other programs to manipulate ELF and DWARF data. WWW: https://fedorahosted.org/elfutils/ Reviewed by: bdrewery Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7206
Notes
Notes: svn path=/head/; revision=418495
Diffstat (limited to 'devel/elfutils/files/patch-lib_error.c')
-rw-r--r--devel/elfutils/files/patch-lib_error.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/devel/elfutils/files/patch-lib_error.c b/devel/elfutils/files/patch-lib_error.c
new file mode 100644
index 000000000000..e80726187fbf
--- /dev/null
+++ b/devel/elfutils/files/patch-lib_error.c
@@ -0,0 +1,67 @@
+--- lib/error.c.orig 2016-07-13 06:58:54 UTC
++++ lib/error.c
+@@ -0,0 +1,64 @@
++#include <err.h>
++#include <errno.h>
++#include <stdarg.h>
++#include <stdio.h>
++
++#include "error.h"
++
++unsigned int error_message_count;
++int error_one_per_line;
++void (*error_print_progname)(void) = NULL;
++
++static const char *lastfile;
++static unsigned lastline;
++
++/* Good enough. */
++
++void
++error_at_line(int status, int errnum, const char *fn, unsigned line,
++ const char *format, ...)
++{
++ va_list ap;
++ int serrno;
++
++ if (error_one_per_line != 0 && fn != NULL && fn == lastfile && line ==
++ lastline)
++ return;
++
++ serrno = errno;
++ errno = errnum;
++
++ fflush(stdout);
++
++ if (error_print_progname != NULL) {
++ error_print_progname();
++ fprintf(stderr, ":");
++ }
++
++ if (fn != NULL) {
++ lastfile = fn;
++ lastline = line;
++
++ fprintf(stderr, "%s:%u: ", fn, line);
++ } else if (error_print_progname != NULL) {
++ fprintf(stderr, " ");
++ }
++
++ va_start(ap, format);
++ if (status) {
++ if (errnum)
++ verr(status, format, ap);
++ else
++ verrx(status, format, ap);
++ } else {
++ if (errnum)
++ vwarn(format, ap);
++ else
++ vwarnx(format, ap);
++ }
++ va_end(ap);
++
++ errno = serrno;
++ error_message_count++;
++}
++