aboutsummaryrefslogtreecommitdiff
path: root/gdb/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/main.c')
-rw-r--r--gdb/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/main.c b/gdb/main.c
index fe80511..66ba75b 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -549,11 +549,10 @@ captured_main_1 (struct captured_main_args *context)
(xstrprintf ("%s: warning: ", gdb_program_name));
warning_pre_print = tmp_warn_preprint.get ();
- if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+ current_directory = getcwd (NULL, 0);
+ if (current_directory == NULL)
perror_warning_with_name (_("error finding working directory"));
- current_directory = gdb_dirbuf;
-
/* Set the sysroot path. */
gdb_sysroot = relocate_gdb_directory (TARGET_SYSTEM_ROOT,
TARGET_SYSTEM_ROOT_RELOCATABLE);