diff options
author | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 08:10:41 +0000 |
---|---|---|
committer | uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-15 08:10:41 +0000 |
commit | 94bec41ba73431ece552531330d2c1a7e6fa10b7 (patch) | |
tree | 67e523c86d557fad96ecc174028975ceba2f2c61 /fixincludes | |
parent | 30d89cd0052b5152a5e7a17bb28debd788df91dc (diff) | |
download | gcc-94bec41ba73431ece552531330d2c1a7e6fa10b7.tar.gz |
* server.c (server_setup): Check return value of
getcwd and in case of error set buff[0] to 0.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218732 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'fixincludes')
-rw-r--r-- | fixincludes/ChangeLog | 5 | ||||
-rw-r--r-- | fixincludes/server.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index 54945b50a89..571b6d17f60 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,8 @@ +2014-12-15 Uros Bizjak <ubizjak@gmail.com> + + * server.c (server_setup): Check return value of + getcwd and in case of error set buff[0] to 0. + 2014-10-21 Uros Bizjak <ubizjak@gmail.com> * inclhack.def (glibc_c99_inline_4): Add pthread.h to files. diff --git a/fixincludes/server.c b/fixincludes/server.c index 1e50efc9faa..f1b93a0c388 100644 --- a/fixincludes/server.c +++ b/fixincludes/server.c @@ -192,7 +192,8 @@ server_setup (void) fputs ("trap : 1\n", server_pair.pf_write); fflush (server_pair.pf_write); - getcwd (buff, MAXPATHLEN + 1); + if (getcwd (buff, MAXPATHLEN + 1) == NULL) + buff[0] = 0; p_cur_dir = xstrdup (buff); } |