summaryrefslogtreecommitdiff
path: root/debian/patches/0005-strerror_r.patch
blob: 0aba0d4ce7e4d1c3d2c489a0fe8cbf7fcaa5aa28 (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
From: Igor Pashev <pashev.igor@gmail.com>
Date: Sat, 1 Sep 2012 14:47:37 +0000
Subject: strerror_r()

---
 src/generic/util/util.cc |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Index: aptitude/src/generic/util/util.cc
===================================================================
--- aptitude.orig/src/generic/util/util.cc	2013-03-09 18:28:30.615140195 +0000
+++ aptitude/src/generic/util/util.cc	2013-03-09 18:35:31.188026320 +0000
@@ -208,10 +208,14 @@
   while(bufsize < 512 * 512)
     {
       char *buf = new char[bufsize];
-
+#if defined(_GNU_SOURCE)
       char *result = strerror_r(errnum, buf, bufsize);
-
-      if(result == NULL)
+      if (result == NULL)
+#else
+      char *result = buf;
+      int rc = strerror_r(errnum, buf, bufsize);
+      if (rc != 0)
+#endif
 	{
 	  int strerror_errno = errno;