Line 0
Link Here
|
|
|
1 |
From 6975c54a5cd4f1c6d91401a9cfc90d618f5516ee Mon Sep 17 00:00:00 2001 |
2 |
From: Heiko Przybyl <zuxez@cs.tu-berlin.de> |
3 |
Date: Tue, 22 Sep 2009 20:07:48 +0200 |
4 |
Subject: [PATCH 1/1] Avoid usage of get_current_dir_name() on non-GNU targets. |
5 |
|
6 |
The testsuite uses get_current_dir_name() to determine the current |
7 |
directory for the bootstrap download of the images. Unfortunately this |
8 |
function is a GNU-extension and thus not available on platforms that |
9 |
aren't GNU, e.g. MacOSX. So guard get_current_dir_name() with _GNU_SOURCE |
10 |
and if not available fall back to POSIX getcwd(). |
11 |
--- |
12 |
testsuite/testsuite.cpp | 5 +++++ |
13 |
1 files changed, 5 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/testsuite/testsuite.cpp b/testsuite/testsuite.cpp |
16 |
index 402f7ba..9e7d8da 100644 |
17 |
--- a/testsuite/testsuite.cpp |
18 |
+++ b/testsuite/testsuite.cpp |
19 |
@@ -853,7 +853,12 @@ int main(int argc, char ** argv) |
20 |
break; |
21 |
case 'd': |
22 |
if(optarg[0] != '/') { |
23 |
+#ifdef _GNU_SOURCE |
24 |
char * dir = get_current_dir_name(); |
25 |
+#else |
26 |
+ char * dir = (char *) malloc(PATH_MAX * sizeof(char)); |
27 |
+ getcwd(dir, PATH_MAX); |
28 |
+#endif |
29 |
download_dir = dir; |
30 |
download_dir += '/'; |
31 |
download_dir += optarg; |
32 |
-- |
33 |
1.6.4.2 |
34 |
|