summaryrefslogtreecommitdiff
path: root/debian/patches/leaks0001-xxx-print-fail.patch
blob: de9fc0ed2b231357d8dd30450f208e4c6208ecdf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 6f7a1ab15d87b9d47e5d05c0b473c7e645385afe Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Sat, 4 Jun 2016 04:40:44 +0200
Subject: [PATCH hurd 1/2] xxx print fail

---
 libshouldbeinlibc/assert-backtrace.c | 8 ++++++++
 libshouldbeinlibc/assert-backtrace.h | 6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/libshouldbeinlibc/assert-backtrace.c b/libshouldbeinlibc/assert-backtrace.c
index ca23c8d..72a49e9 100644
--- a/libshouldbeinlibc/assert-backtrace.c
+++ b/libshouldbeinlibc/assert-backtrace.c
@@ -76,4 +76,12 @@ __assert_perror_fail_backtrace (int errnum,
 
 }
 
+void
+__print_fail_backtrace (const char *message, const char *file,
+                        unsigned int line, const char *function)
+{
+  __assert_fail_base_backtrace ("%s: %s:%u: %s: %s.\n",
+				message, file, line, function);
+}
+
 #endif /* ! defined NDEBUG */
diff --git a/libshouldbeinlibc/assert-backtrace.h b/libshouldbeinlibc/assert-backtrace.h
index c54b810..b36e5b2 100644
--- a/libshouldbeinlibc/assert-backtrace.h
+++ b/libshouldbeinlibc/assert-backtrace.h
@@ -42,6 +42,12 @@ void __assert_perror_fail_backtrace (int errnum,
 				     const char *function)
   __attribute__ ((noreturn, unused));
 
+/* Likewise, but prints the given MESSAGE.  */
+void
+__print_fail_backtrace (const char *message, const char *file,
+                        unsigned int line, const char *function)
+  __attribute__ ((noreturn, unused));
+
 #define assert_backtrace(expr)						\
   ((expr)								\
    ? (void) 0								\
-- 
2.1.4