aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/runtime/main.c
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-09-15 14:52:46 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-09-15 14:52:46 +0000
commit2515e5a7a08bdb033e3fe6370774cf7359b9811e (patch)
tree0048e16af72d2eef9bf9f9e8ac0d78574ea4bf40 /libgfortran/runtime/main.c
parent7c4d947f29a565331ef92c4f0a15624b4821269a (diff)
downloadgcc-2515e5a7a08bdb033e3fe6370774cf7359b9811e.zip
gcc-2515e5a7a08bdb033e3fe6370774cf7359b9811e.tar.gz
gcc-2515e5a7a08bdb033e3fe6370774cf7359b9811e.tar.bz2
re PR libfortran/21185 (Improve testsuite results on newlib targets)
PR libfortran/21185 * runtime/compile_options.c (set_options): Fix typo. * runtime/main.c (store_exe_path): If getcwd is not available, don't use it. * intrinsics/getcwd.c: Same thing here. * io/unix.c (fallback_access): New fallback function for access. (fix_fd): Don't use dup if it's not available. * configure.ac: Check for dup and getcwd. * configure: Regenerate. * config.h.in: Regenerate. From-SVN: r128512
Diffstat (limited to 'libgfortran/runtime/main.c')
-rw-r--r--libgfortran/runtime/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgfortran/runtime/main.c b/libgfortran/runtime/main.c
index be12c59..86777d9 100644
--- a/libgfortran/runtime/main.c
+++ b/libgfortran/runtime/main.c
@@ -120,7 +120,11 @@ store_exe_path (const char * argv0)
}
memset (buf, 0, sizeof (buf));
+#ifdef HAVE_GETCWD
cwd = getcwd (buf, sizeof (buf));
+#else
+ cwd = "";
+#endif
/* exe_path will be cwd + "/" + argv[0] + "\0" */
path = malloc (strlen (cwd) + 1 + strlen (argv0) + 1);