summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Landden <shawn@git.icu>2018-07-30 18:19:49 -0700
committerShawn Landden <shawn@git.icu>2018-07-30 18:19:49 -0700
commitd80562b5ba6ddd1e3818388dfef8e4d7739a2d6e (patch)
tree469ed3ebaf35ea595b9b41f72fdfeff6c038cd2e
parent5b57482cf5d7debfaad7b635da14c00d4c0790d6 (diff)
downloaddistcc-git-d80562b5ba6ddd1e3818388dfef8e4d7739a2d6e.tar.gz
cross-compile: fix previous patch on mac OSX
-rw-r--r--src/compile.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compile.c b/src/compile.c
index 8f90151..bbe0cea 100644
--- a/src/compile.c
+++ b/src/compile.c
@@ -491,9 +491,12 @@ static void dcc_rewrite_generic_compiler(char **argv)
if ((st.st_mode & S_IFMT) == S_IFLNK) {
/* this is a Debian thing. Fedora just has /usr/bin/cc -> gcc */
if (strcmp(linkbuf, cpp ? "/etc/alternatives/c++" : "/etc/alternatives/cc") == 0) {
- char *intermediate_link = strdupa(linkbuf);
+ char m[MAXPATHLEN + 1];
- ssz = readlinkat(dir, intermediate_link, linkbuf, sizeof(linkbuf) - 1);
+ m[0] = '\0';
+ strcpy(m, linkbuf);
+
+ ssz = readlinkat(dir, m, linkbuf, sizeof(linkbuf) - 1);
linkbuf[ssz] = '\0';
}
}