From: Uros Bizjak Date: Mon, 15 Dec 2014 08:10:41 +0000 (+0100) Subject: server.c (server_setup): Check return value of getcwd and in case of error set buff... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=451f11993580c3fb0b80da62885a00f8ee265304;p=gcc.git server.c (server_setup): Check return value of getcwd and in case of error set buff[0] to 0. * server.c (server_setup): Check return value of getcwd and in case of error set buff[0] to 0. From-SVN: r218732 --- 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 + + * server.c (server_setup): Check return value of + getcwd and in case of error set buff[0] to 0. + 2014-10-21 Uros Bizjak * 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); }