summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-04 23:28:00 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-04 23:28:00 +0000
commit8bc418a1c8a1d48a02f3dec97f41f474fbc9c996 (patch)
tree0ef8e186872b5872c231a1c182625bae9792339f /gcc/toplev.c
parent890e483aa5c37de3ea8343f4cf45ca5e983cf9df (diff)
downloadgcc-8bc418a1c8a1d48a02f3dec97f41f474fbc9c996.tar.gz
* toplev.c (get_src_pwd): Handle failure of getpwd().
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92910 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 5a5702f0de2..c403b110fd2 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -449,7 +449,11 @@ const char *
get_src_pwd (void)
{
if (! src_pwd)
- src_pwd = getpwd ();
+ {
+ src_pwd = getpwd ();
+ if (!src_pwd)
+ src_pwd = ".";
+ }
return src_pwd;
}